|
| |
|
|
yb2
Posts: 653 Joined: 1/30/2006 Status: offline
|
javascript people, come to my aid - 4/3/2006 17:48:42
my javascript is dodgy to say the least, so can someone tell me why this doesn't work and help me fix it, please? When the link is clicked I want an alert box to pop up, but it doesn't. <script language="javascript"> var bc = document.getElementById('newsbutton'); bc.addEventListener('click', function(e){ alert( "hello"); }, true); </script> ... <a href="default.aspx" id="newsbutton">blah</a> Any help gratefully accepted.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: javascript people, come to my aid - 4/4/2006 11:12:49
quote:
When the link is clicked I want an alert box to pop up Without knowing more, you should be able to do something directly like this: <a href="default.aspx" id="newsbutton" onClick"javascript:alert('Hello!');">blah</a> That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
yb2
Posts: 653 Joined: 1/30/2006 Status: offline
|
RE: javascript people, come to my aid - 4/4/2006 15:48:43
I saw that there were different versions but I thought the event handling was a current version. Is that right? I've been using FF to test this, has it got the right DOM? This is why I steer away from js - I always end up in trouble :)
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|