Preserved Topic: Difference between using href=javascript:... and onClick=....? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 02-07-2002 23:25
Hmmm... I guess I'm wrong... |
Maniac (V) Inmate From: Brisbane, Australia |
posted 02-08-2002 00:04
You shouldn't be having a problem but I was curious so I decided to test it. It appears that using "this" points to different objects depending on which method your using. Here's my little example: |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-08-2002 00:20
It's because onclick is an event of the A element object. The JavaScript URL is in no way related to the A element. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 02-08-2002 02:21
Ah - that makes sense (the event part). |
Paranoid (IV) Inmate From: under your rug, |
posted 02-08-2002 04:01
Here read this it should be helpfull ( click me ) |
Paranoid (IV) Inmate From: under your rug, |
posted 02-08-2002 05:23
None of those will work on netscape 4 or IE 4 will they? |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 02-08-2002 05:28 |
Obsessive-Compulsive (I) Inmate From: Tampa, FL |
posted 09-13-2002 22:21
I'm pretty new here (started reading in the last few days) but I came across this thread, and wanted to throw my 2 cents worth in. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-14-2002 00:03
There are two reasons for putting the href in the link: |