By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,385 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,385 IT Pros & Developers. It's quick & easy.

Why?

P: n/a
Why?

==============
Oh please:<br>
<a href='javascript:"I told you so!";'>
Do not click me!</a>
==============

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Oct 7 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Lee
Evertjan. said:

Why?

==============
Oh please:<br>
<a href='javascript:"I told you so!";'>
Do not click me!</a>
==============


It does exactly what the javascript: protocol is supposed to do:
Replace the current page with the value of the Javascript expression.

Oct 7 '05 #2

P: n/a
Lee wrote on 07 okt 2005 in comp.lang.javascript:
Evertjan. said:

Why?

==============
Oh please:<br>
<a href='javascript:"I told you so!";'>
Do not click me!</a>
==============


It does exactly what the javascript: protocol is supposed to do:
Replace the current page with the value of the Javascript expression.


So it is the same as:

href='javascript:document.write("I told you so!");'

???

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Oct 7 '05 #3

P: n/a
Evertjan. said the following on 10/7/2005 12:14 PM:
Lee wrote on 07 okt 2005 in comp.lang.javascript:

Evertjan. said:
Why?

==============
Oh please:<br>
<a href='javascript:"I told you so!";'>
Do not click me!</a>
==============


It does exactly what the javascript: protocol is supposed to do:
Replace the current page with the value of the Javascript expression.

So it is the same as:

href='javascript:document.write("I told you so!");'

???


No.
document.write will replace the current content of the page.
javascript:"I told you so!" will replace the current page itself.

Although both will create a new entry in the History trail.

Test both and look at the title bar. View Source and look at the file names.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 7 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.