Fun with window.alert

Discussion in 'HTML' started by Toby A Inkster, Sep 18, 2003.

  1. Here is a nice way of adding a JavaScript window.alert message that still
    works when JavaScript is disabled! (But only in Gecko and Opera 7.2.)

    <a href="data:,&quot;Hello%20World&quote;"
    onclick="window.alert(unescape(this.href.substr(6))); return false;">Test</a>

    Groovy. :)

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Sep 18, 2003
    #1
    1. Advertising

  2. Toby A Inkster

    Whitecrest Guest

    In article <>,
    says...

    > Here is a nice way of adding a JavaScript window.alert message that still
    > works when JavaScript is disabled! (But only in Gecko and Opera 7.2.)
    > <a href="data:,&quot;Hello%20World&quote;"
    > onclick="window.alert(unescape(this.href.substr(6))); return false;">Test</a>


    Have not tried it, but if it does not work in about 80% of the browsers,
    then aren't you doing the same thing that you tell me I should not do?
    That is, have a solution that does not work for everyone.

    And in this case, that everyone, is more than 80% of the people out
    there. Personally I think if that is what you are looking for, say to
    have an alert that says something like "ha ha IE users can't see this",
    then more power to you. (That is actually a pretty cool way to use it.)

    --
    Whitecrest Entertainment
    www.whitecrestent.com
     
    Whitecrest, Sep 18, 2003
    #2
    1. Advertising

  3. Whitecrest wrote:

    > In article <>,
    > says...
    >
    >> Here is a nice way of adding a JavaScript window.alert message that still
    >> works when JavaScript is disabled! (But only in Gecko and Opera 7.2.)
    >> <a href="data:,&quot;Hello%20World&quote;"
    >> onclick="window.alert(unescape(this.href.substr(6))); return false;">Test</a>

    >
    > Have not tried it, but if it does not work in about 80% of the browsers,
    > then aren't you doing the same thing that you tell me I should not do?
    > That is, have a solution that does not work for everyone.


    Err no. You misinterpret me. It works in all JavaScript-supporting
    browsers, *plus* it works in Opera and Gecko when JavaScript is disabled.

    So it works more often than a typical window.alert message.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Sep 18, 2003
    #3
  4. Toby A Inkster

    SeeSchloss Guest

    > Whitecrest wrote:
    >
    >> In article <>,
    >> says...
    >>
    >>> Here is a nice way of adding a JavaScript window.alert message
    >>> that still works when JavaScript is disabled! (But only in
    >>> Gecko and Opera 7.2.) <a
    >>> href="data:,&quot;Hello%20World&quote;"
    >>> onclick="window.alert(unescape(this.href.substr(6))); return
    >>> false;">Test</a>

    >>
    >> Have not tried it, but if it does not work in about 80% of the
    >> browsers, then aren't you doing the same thing that you tell me
    >> I should not do? That is, have a solution that does not work for
    >> everyone.

    >
    > Err no. You misinterpret me. It works in all
    > JavaScript-supporting browsers, *plus* it works in Opera and
    > Gecko when JavaScript is disabled.
    >
    > So it works more often than a typical window.alert message.


    So the interest is ?... to annoy users who have disabled
    javascript especially not to get all these sort of things ?


    --
    SeeSchlo├č - http://gpu.sourceforge.net
     
    SeeSchloss, Sep 18, 2003
    #4
  5. SeeSchloss wrote:

    > > Whitecrest wrote:
    > >
    > > Err no. You misinterpret me. It works in all
    > > JavaScript-supporting browsers, *plus* it works in Opera and
    > > Gecko when JavaScript is disabled.
    > >
    > > So it works more often than a typical window.alert message.

    >
    > So the interest is ?... to annoy users who have disabled
    > javascript especially not to get all these sort of things ?


    Point out a security issue with browsers that execute Javascript even
    when it's supposed to be of?

    --
    Klaus Johannes Rusch

    http://www.atmedia.net/KlausRusch/
     
    Klaus Johannes Rusch, Sep 19, 2003
    #5
  6. Klaus Johannes Rusch wrote:

    > SeeSchloss wrote:
    >
    >> > Whitecrest wrote:
    >> >
    >> > Err no. You misinterpret me. It works in all
    >> > JavaScript-supporting browsers, *plus* it works in Opera and
    >> > Gecko when JavaScript is disabled.
    >> >
    >> > So it works more often than a typical window.alert message.

    >>
    >> So the interest is ?... to annoy users who have disabled
    >> javascript especially not to get all these sort of things ?

    >
    > Point out a security issue with browsers that execute Javascript even
    > when it's supposed to be of?


    No, they don't.

    It just uses a "data:" URL to display the text instead of JavaScript.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Sep 19, 2003
    #6
    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. Andy Fish
    Replies:
    65
    Views:
    1,827
    Mabden
    May 18, 2004
  2. Mersh
    Replies:
    0
    Views:
    526
    Mersh
    Mar 13, 2007
  3. Ganesh
    Replies:
    0
    Views:
    585
    Ganesh
    Jun 29, 2007
  4. dolphin
    Replies:
    4
    Views:
    343
    Jorgen Grahn
    Aug 25, 2007
  5. er
    Replies:
    2
    Views:
    545
Loading...

Share This Page