•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 422,659 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,682 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 490 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 117
Reputation:
Rep Power: 1
Solved Threads: 0
hi,
Please tell me what is wrong with this simple piece of code. It won't show up anything. Thank you.
<html>
<head>
<title>onclick</title>
</head>
<body>
<p>
<script language="javascript" type="text/javascript">
<a href="http://www.yahoo.com" onClick="alert('popup');">click this link</a>to test
</script>
</p>
</body>
</html>
Please tell me what is wrong with this simple piece of code. It won't show up anything. Thank you.
<html>
<head>
<title>onclick</title>
</head>
<body>
<p>
<script language="javascript" type="text/javascript">
<a href="http://www.yahoo.com" onClick="alert('popup');">click this link</a>to test
</script>
</p>
</body>
</html>
•
•
Join Date: Apr 2005
Location: New York state
Posts: 464
Reputation:
Rep Power: 5
Solved Threads: 72
It doesn't work because you don't need to surround the link with script tags for that inline javascript to work. The
<a href="http://www.yahoo.com" onClick="alert('popup');">click this link</a> will work just fine on its own. GCS d- s+:+ a-->? C++(++++) UL+++ P+>+++ L+++ !E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r z+*
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r z+*
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age ajax asp business cross-browser javascript menu with few lines of code developer development environment firefox home html ibm. news internet it javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator microsoft msdn news office prevent javascript menu from getting hidden under flash movies remote working site software sql trends vista web working
- Help with CSS - background extending to 100% (HTML and CSS)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- NEQ not working for IF command?! (Computer Science and Software Design)
- Problem with working with math in C (C)
- Working with SQL's Text data type (ASP.NET)
- I've made some code to reject age ranges, but cant get it working (Java)
- CD-ROm isnt working correctly (Storage)
- IE has stopped working - is it Virus related? (Viruses, Spyware and other Nasties)
- Simple IRC Connection (C++)
- Pipe inside variable isn't working in bash (Shell Scripting)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Displaying full text of options in select
- Next Thread: Javscript variables to Server-side


Linear Mode