Fun with window.alert

T

Toby A Inkster

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. :)
 
W

Whitecrest

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.)
 
T

Toby A Inkster

Whitecrest said:
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.
 
S

SeeSchloss

Whitecrest said:
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 ?
 
K

Klaus Johannes Rusch

SeeSchloss said:
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?
 
T

Toby A Inkster

Klaus said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top