Why?

Discussion in 'Javascript' started by Evertjan., Oct 7, 2005.

  1. Evertjan.

    Evertjan. Guest

    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)
    Evertjan., Oct 7, 2005
    #1
    1. Advertising

  2. Evertjan.

    Lee Guest

    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.
    Lee, Oct 7, 2005
    #2
    1. Advertising

  3. Evertjan.

    Evertjan. Guest

    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)
    Evertjan., Oct 7, 2005
    #3
  4. Evertjan.

    Randy Webb Guest

    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
    Randy Webb, Oct 7, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGltOjouLg==?=

    Why, why, why???

    =?Utf-8?B?VGltOjouLg==?=, Jan 27, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    562
    Juan T. Llibre
    Jan 27, 2005
  2. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    455
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  3. Mr. SweatyFinger

    VWD why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    380
    =?Utf-8?B?Q2lhcmFuIE8nJycnRG9ubmVsbA==?=
    Dec 21, 2006
  4. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    874
    Mark Rae
    Dec 21, 2006
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,803
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page