Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Preventing "Prevent this page from creating additional dialogs"

7,609 views
Skip to first unread message

larry....@gmail.com

unread,
Mar 23, 2012, 8:12:00 PM3/23/12
to
I have an alert that is displayed on an error. The second time the
alert is displayed, it comes up with a checkbox that says "Prevent
this page from creating additional dialogs". If this is checked the
alert no longer gets displayed. How can I prevent that message so that
the alert is always displayed?

Scott Johnson

unread,
Mar 24, 2012, 9:55:26 AM3/24/12
to
Tip: don't check the box!

First off not sure you can or should, that would be a browser security
feature.

Secondly, why would you want to?
If you are only using it to display error messages (which I doubt), then
the extra line is pretty inconsequential and the data is still visible.
If you are trying to circumvent the clients no-popup wishes, well then
'bye-bye'.

larry....@gmail.com

unread,
Mar 24, 2012, 10:58:07 AM3/24/12
to
On Mar 24, 7:55 am, Scott Johnson <nooneh...@chalupasworld.com> wrote:
> On 3/23/2012 5:12 PM, Larry.Mart...@gmail.com wrote:
>
> > I have an alert that is displayed on an error. The second time the
> > alert is displayed, it comes up with a checkbox that says "Prevent
> > this page from creating additional dialogs". If this is checked the
> > alert no longer gets displayed. How can I prevent that message so that
> > the alert is always displayed?
>
> Tip: don't check the box!

I can't control what the user does.

>
> First off not sure you can or should, that would be a browser security
> feature.
>
> Secondly, why would you want to?

This is an internal app, and this is what the client I work for wants.

> If you are only using it to display error messages (which I doubt), then
> the extra line is pretty inconsequential and the data is still visible.

I don't really care about the alert, but I have a onkeyup event that
checks their input in a text field. If they enter something invalid,
the alert tells then, and then when they dismiss it, it removes the
offending character from the text field. Once they check the "Prevent
this page from creating additional dialogs" box, it seems my event
handler doesn't get called any more, cause the offending character
stops getting removed. If I could get that to still happen, I'd be OK
with the alert not showing.


> If you are trying to circumvent the clients no-popup wishes, well then
> 'bye-bye'.

The client is who is asking for this.

Tom de Neef

unread,
Mar 24, 2012, 12:06:30 PM3/24/12
to
"Larry....@gmail.com" <larry....@gmail.com> schreef in bericht
news:8c8ded8c-6649-4772...@s9g2000pba.googlegroups.com...
Will all other alerts be prevented or just the one with the same message. In
the latter case: modify the message by appending a hidden random number.
Tom


Rick Viscomi

unread,
Mar 24, 2012, 2:24:32 PM3/24/12
to
The solution is to not use alerts. Use a popup div, which also gives you style control for browser consistency.

Denis McMahon

unread,
Mar 24, 2012, 2:41:17 PM3/24/12
to
In this context, the "client" or "user" is the person whose web browser
is rendering your server delivered content. Not the customer who is
paying you to develop that content.

The only solution is for your customer to commision a modified browser
build and roll that out to his users.

Basically you're asking to disable a browser security feature. Browser
security features aren't meant to be disabled by content delivered from
the server, they're meant to be wholly under the control of the person
(user) on whose computer the "client" browser process is running.

If you do figure out a way to disable a browser security feature, you
should enter into one of those competitions where people get prizes of
several tens of thousands of dollars for showing browser coders where
there are security holes in their browser!

Point out to your "customer" that the feature he is asking for can only
be delivered by a customised browser build, you'll need to start with a
browser whose source code is available under something like GPL, and if
his "internal" users then use the modified browser to access external
websites, they will be at an extremely high risk of getting hit by all
sorts of exploits unless he employs someone on an ongoing basis to
rebuild and roll out a new custom build every time a security patch gets
applied in the upstream source.

Rgds

Denis McMahon

Scott Johnson

unread,
Mar 24, 2012, 11:59:20 PM3/24/12
to
You are using the wrong tool for alerting the client (browser user) that
there was a validation error. If you are validating the field in real
time them set up a notice box and then use innerhtml to push the messages.
Something as simple as an empty DIV will work and then you can style it
also.

Scott Johnson

unread,
Mar 25, 2012, 12:01:03 AM3/25/12
to
Woops did not see this before I responded. Beesknees!

larry....@gmail.com

unread,
Mar 25, 2012, 3:26:38 PM3/25/12
to
On Mar 24, 8:58 am, "Larry.Mart...@gmail.com"
I figured out was was going on here. Once the "Prevent this page from
creating additional dialogs" was checked, then the alert() was
throwing an exception. That's what was preventing the rest of my
onkeyup event handler from running. Once I put it in a try/catch the
rest of the event handler still ran. That's what's really important,
so I don't need to worry about this any more.

Scott Johnson

unread,
Mar 25, 2012, 7:55:28 PM3/25/12
to
Good catch.

I have never used the alert for client side use so I was not even sure
how you would continue the script without it being clicked. Now I know.

Scotty

David Mark

unread,
Mar 28, 2012, 11:16:35 PM3/28/12
to
Browser consistency? An alert will look exactly as the user of a
specific browser expects. It won't appear off the screen or require a
lot of complicated script to work in cross-browser fashion. Jumping
through hoops just to style it to look like something other than an
alert seems counterproductive.

Best to avoid overlapping pop-ups of any kind when possible (certainly
the case with validation functions).

theA...@yahoo.com

unread,
Apr 2, 2012, 7:16:23 PM4/2/12
to
A popUp div seems like a reasonable solution; but when this popUp div appears on the screen & the User clicks outside the popUp div, then isn't the popUp simply minimized? (You could use an onblur window.close(), but is that desirable?)

And once the popUp div is minimized, any subsequent calls to the popUp div will not cause the new/next popUp div to appear on the User's screen because it's already minimized?

A valuable aspect of "alert();" is that it is modal(?), i.e. requires User response before resuming app execution.

popUp div's and/or perhaps a little piece of the screen's "real estate" being dedicated to error msgs (& the like) provide some degree of User interaction; but they don't have the impact of an "alert" or "confirm" or "prompt" box.

Gene Wirchenko

unread,
Apr 3, 2012, 12:11:16 AM4/3/12
to
On Mon, 2 Apr 2012 16:16:23 -0700 (PDT), theA...@yahoo.com wrote:

[snip]

>A valuable aspect of "alert();" is that it is modal(?), i.e. requires User response before resuming app execution.

An unvaluable aspect of alert() is that the button captions are
often inappropriate. I am looking at having a Cancel button for a
form and wish to have it confirmed. Unfortunately,
fChoice=alert("Really cancel?");
has issues. (Which button should confirm the cancellation, and which
should cancel the cancellation?)

[snip]

Sincerely,

Gene Wirchenko

Evertjan.

unread,
Apr 3, 2012, 3:01:07 AM4/3/12
to
alert(); has only one button.

Methinks you are not talking about alert(); but about confirm();

The problem with these button texts is,
that they use the language of the operating system settings.

var choice = confirm("Really cancel?");

is only understandable in certain OS language settings,
even where the page language is English.

See:
<http://hannivoort.org/test/confirmChromeDutch.jpg>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jeff North

unread,
Apr 3, 2012, 3:20:14 AM4/3/12
to
On Mon, 02 Apr 2012 21:11:16 -0700, in comp.lang.javascript Gene
Wirchenko <ge...@ocis.net>
That is why there is a confirm(message) window method.

David Mark

unread,
Apr 3, 2012, 3:28:50 AM4/3/12
to
On Apr 3, 12:11 am, Gene Wirchenko <ge...@ocis.net> wrote:
> On Mon, 2 Apr 2012 16:16:23 -0700 (PDT), theAba...@yahoo.com wrote:
>
> [snip]
>
> >A valuable aspect of "alert();" is that it is modal(?), i.e. requires User response before resuming app execution.
>
>      An unvaluable aspect of alert() is that the button captions are
> often inappropriate.  I am looking at having a Cancel button for a
> form and wish to have it confirmed.  Unfortunately,
>           fChoice=alert("Really cancel?");
> has issues.  (Which button should confirm the cancellation, and which
> should cancel the cancellation?)
>

As mentioned, you've got hold of a - confirm - there. And with OK/
Cancel you make statements (e.g. You will lose your unsaved data).
Questions are for Yes/No dialogs. OK/Cancel is what browsers use, so
deal with it.

Evertjan.

unread,
Apr 3, 2012, 7:24:10 AM4/3/12
to
David Mark wrote on 03 apr 2012 in comp.lang.javascript:

> OK/Cancel is what browsers use, so
> deal with it.

Only with the OS set to English.

Jeff North

unread,
Apr 3, 2012, 8:06:53 AM4/3/12
to
On Mon, 2 Apr 2012 16:16:23 -0700 (PDT), in comp.lang.javascript
theA...@yahoo.com
<30433830.1107.1333408583298.JavaMail.geo-discussion-forums@yneo2>
wrote:

>| On Saturday, March 24, 2012 1:24:32 PM UTC-5, Rick Viscomi wrote:
>| > On Friday, March 23, 2012 8:12:00 PM UTC-4, Larry....@gmail.com wrote:
>| > > I have an alert that is displayed on an error. The second time the
>| > > alert is displayed, it comes up with a checkbox that says "Prevent
>| > > this page from creating additional dialogs". If this is checked the
>| > > alert no longer gets displayed. How can I prevent that message so that
>| > > the alert is always displayed?
>| >
>| > The solution is to not use alerts. Use a popup div, which also gives you style control for browser consistency.

>| A popUp div seems like a reasonable solution; but when this popUp div appears on the screen & the User clicks outside the popUp div, then isn't the popUp simply minimized? (You could use an onblur window.close(), but is that desirable?)
>|
>| And once the popUp div is minimized, any subsequent calls to the popUp div will not cause the new/next popUp div to appear on the User's screen because it's already minimized?
>|
>| A valuable aspect of "alert();" is that it is modal(?), i.e. requires User response before resuming app execution.
>|
>| popUp div's and/or perhaps a little piece of the screen's "real estate" being dedicated to error msgs (& the like) provide some degree of User interaction; but they don't have the impact of an "alert" or "confirm" or "prompt" box.
>|

Not really. A div is either displayed or hidden. In css you would use:
.tooltip { display: none; width: ..... }
.tooltip:hover {display: block }

If for popup divs you can look at the code at:
http://jeffnorth.com/newsgroup/popups.html

Matt McDonald

unread,
Apr 3, 2012, 10:35:30 AM4/3/12
to
On 12-03-28 09:16 PM, David Mark wrote:
> Best to avoid overlapping pop-ups of any kind when possible (certainly
> the case with validation functions).

I've had problems with Opera (Linux Mint) recently regarding
overlapping dialogs. I have per-cookie monitoring set, which
yields a prompt for every single cookie. Sometimes an unexpected
cookie will be "prompted" while I'm about to switch tabs (via
ctrl + tab). When I change tabs, the expected modal "dialog"
comes up, except underneath the cookie "prompt". This causes
Opera to lock up every time without fail.

--
Matt McDonald: Web/Flash Developer; Edmonton, Alberta, Canada

Gene Wirchenko

unread,
Apr 3, 2012, 11:28:43 AM4/3/12
to
On 03 Apr 2012 07:01:07 GMT, "Evertjan."
<exjxw.ha...@interxnl.net> wrote:

[snip]

>alert(); has only one button.
>
>Methinks you are not talking about alert(); but about confirm();

Quite. Sorry for the error, folks.

[snip]

Sincerely,

Gene Wirchenko

Gene Wirchenko

unread,
Apr 3, 2012, 11:37:16 AM4/3/12
to
Like say:
You are about to cancel the report.
OK Cancel
Oops!

A similar problem happened on a non-Web system called Andrew.
Andrew would ask for confirmation on actions which could have nasty
consequences. The choices were "Continue" to continue the action and
"Quit" to quit (cancel) the action. One of the actions that required
confirmation was quitting Andrew. The prompt would have been
something like
Really quit Andrew?
Continue Quit

The intention was that continue means to continue quitting and
quit means to quit quitting, but it is also sensible to read it as
continue with Andrew and to quit Andrew.

Many of us would like something more flexible so as to avoid such
awkwardness.

Sincerely,

Gene Wirchenko

Dr J R Stockton

unread,
Apr 4, 2012, 4:13:01 PM4/4/12
to
In comp.lang.javascript message <XnsA02A8856...@194.109.133.133>
, Tue, 3 Apr 2012 11:24:10, Evertjan. <exjxw.ha...@interxnl.net>
posted:

>David Mark wrote on 03 apr 2012 in comp.lang.javascript:
>
>> OK/Cancel is what browsers use, so
>> deal with it.
>
>Only with the OS set to English.

<http://www.merlyn.demon.co.uk/quotings.htm#FredHoyle> : it's worked
with you.


What is needed is a General Asker.

window.asker = function(A, B, C, D, E, F) { native code }

A is an array of strings to show above, between, and under B & C.
B is an array of strings to label input type=text elements
C is an array of strings to preload input type=text elements
D is an array of button legends.
E is an array with E[0] being the number of the default button
F is a number indexing into standard icons such as Error, Warn; or a
reference to an image to be used; or empty.

The return value is an array corresponding to C but as altered, and E[0]
is now the number of the button pressed (with the close box being -1).

Or something equally general - one might use colours, too.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Jeff North

unread,
Apr 5, 2012, 12:12:26 AM4/5/12
to
On Wed, 4 Apr 2012 21:13:01 +0100, in comp.lang.javascript Dr J R
Stockton <repl...@merlyn.demon.co.uk.not.invalid>
<xcijeeTN...@invalid.uk.co.demon.merlyn.invalid> wrote:

>| In comp.lang.javascript message <XnsA02A8856...@194.109.133.133>
>| , Tue, 3 Apr 2012 11:24:10, Evertjan. <exjxw.ha...@interxnl.net>
>| posted:
>|
>| >David Mark wrote on 03 apr 2012 in comp.lang.javascript:
>| >
>| >> OK/Cancel is what browsers use, so
>| >> deal with it.
>| >
>| >Only with the OS set to English.
>|
>| <http://www.merlyn.demon.co.uk/quotings.htm#FredHoyle> : it's worked
>| with you.
>|
>|
>| What is needed is a General Asker.
>|
>| window.asker = function(A, B, C, D, E, F) { native code }
>|
>| A is an array of strings to show above, between, and under B & C.
>| B is an array of strings to label input type=text elements
>| C is an array of strings to preload input type=text elements
>| D is an array of button legends.
>| E is an array with E[0] being the number of the default button
>| F is a number indexing into standard icons such as Error, Warn; or a
>| reference to an image to be used; or empty.
>|
>| The return value is an array corresponding to C but as altered, and E[0]
>| is now the number of the button pressed (with the close box being -1).
>|
>| Or something equally general - one might use colours, too.

Methinks that Dr Stockton has totally missed the point about alert and
confirm dialog boxes.

Evertjan.

unread,
Apr 5, 2012, 4:12:32 AM4/5/12
to
Jeff North wrote on 05 apr 2012 in comp.lang.javascript:
> Methinks that Dr Stockton has totally missed the point about alert and
> confirm dialog boxes.

I don't think so, Jeff.
Dialog boxes have no 'the point'.
The tread or you might have,
on Usenet we are free to change or ignore that.

====================

What is needed is to convince the powers-that-be in the browser world
what we realy need.

How to better show that than writing a sort-of functionality that
implements what should be done on a more system-wide scale,
as John did here.

My suggestion is not to add a function ask(), but to add functionality:

alert(), confirm() and prompt() should, next to their present behavour as
a future default, have the possibility to be more versatile:

[Yes Thomas, window.alert(), etc.]

alert('What?'); // default
alert('What?','lan:nl-nl'); // default with forced language
alert('What?','Go on');
[should aalways return true]

var r = confirm('Are you quite certain?') // default;
var r = confirm('Are you sure?','lan:default'); // default forced lang
var r = confirm('Are you sure?','I am','No, I'm not');
[these return true/false]

var r = confirm('Are you sure?','I am','No, I'm not','Please explain');
var r = confirm('How much is 2+2?','7','4.2','2','Help me!');
[these return the string clicked,
any number of choices>2, displayed vertically]

var r = prompt('How much is 2+2?'); // default
var r = prompt('How much is 2+2?',lan:en-gb');
var r = prompt('How much is 2+2?','Done','Don`t know');
[these return the (perhaps empty) string entered or false]

The arguments should be return any computed value.
alert(array),confirm(array),prompt(array),
should be possible in all above cases.

Gene Wirchenko

unread,
Apr 5, 2012, 11:51:18 AM4/5/12
to
On 05 Apr 2012 08:12:32 GMT, "Evertjan."
<exjxw.ha...@interxnl.net> wrote:

>Jeff North wrote on 05 apr 2012 in comp.lang.javascript:
>> Methinks that Dr Stockton has totally missed the point about alert and
>> confirm dialog boxes.
>
>I don't think so, Jeff.
>Dialog boxes have no 'the point'.
>The tread or you might have,
>on Usenet we are free to change or ignore that.
>
>====================
>
>What is needed is to convince the powers-that-be in the browser world
>what we realy need.

Quite.

>How to better show that than writing a sort-of functionality that
>implements what should be done on a more system-wide scale,
>as John did here.
>
>My suggestion is not to add a function ask(), but to add functionality:

We diagree here, but that is only a name.

>alert(), confirm() and prompt() should, next to their present behavour as
>a future default, have the possibility to be more versatile:
>
>[Yes Thomas, window.alert(), etc.]
>
>alert('What?'); // default
>alert('What?','lan:nl-nl'); // default with forced language
>alert('What?','Go on');
>[should aalways return true]

Why bother having a return value? alert() does not have one now.

>var r = confirm('Are you quite certain?') // default;
>var r = confirm('Are you sure?','lan:default'); // default forced lang
>var r = confirm('Are you sure?','I am','No, I'm not');
>[these return true/false]
>
>var r = confirm('Are you sure?','I am','No, I'm not','Please explain');
>var r = confirm('How much is 2+2?','7','4.2','2','Help me!');
>[these return the string clicked,
>any number of choices>2, displayed vertically]

I think that confirm() should be yes/no only. "confirm" means to
get OK or not and does not fit multiple choice. For multiple choice,
use something else. choose()?

>var r = prompt('How much is 2+2?'); // default
>var r = prompt('How much is 2+2?',lan:en-gb');
>var r = prompt('How much is 2+2?','Done','Don`t know');
>[these return the (perhaps empty) string entered or false]

false for cancelling the prompt with close? What about null?

>The arguments should be return any computed value.

This does not parse. Do you mean that any value should be
returnable? I would stick with character. Process the value if you
need a different type.

>alert(array),confirm(array),prompt(array),
>should be possible in all above cases.

Good idea.

There is one other thing. I want to be able to specify the
default button. There is quite a difference between
Do you really want to print that report?
and
Do you really want to erase the entire database?
It might be fine to default the first one to yes, but it would be
horrible to do so for the second.

Yes, one can reverse the language, but then it often loses the
clarity
Do you mind erasing the entire database?
"Erasing the entire database? ... No! ... ... Oh, NO!"

Sincerely,

Gene Wirchenko

Evertjan.

unread,
Apr 5, 2012, 6:37:10 PM4/5/12
to
But it does, it defaults to not false, try it out.

There are no internal or defined functions without an implicit return
value in javascript.

Think it over, why should this crash?

if (alert(1)) ...

>>var r = confirm('Are you quite certain?') // default;
>>var r = confirm('Are you sure?','lan:default'); // default forced lang
>>var r = confirm('Are you sure?','I am','No, I'm not');
>>[these return true/false]
>>
>>var r = confirm('Are you sure?','I am','No, I'm not','Please
>>explain'); var r = confirm('How much is 2+2?','7','4.2','2','Help
>>me!'); [these return the string clicked,
>>any number of choices>2, displayed vertically]
>
> I think that confirm() should be yes/no only. "confirm" means to
> get OK or not and does not fit multiple choice. For multiple choice,
> use something else. choose()?

The powars are very conversative, If you let tham argue about a new name
you loose valuable years.

>>var r = prompt('How much is 2+2?'); // default
>>var r = prompt('How much is 2+2?',lan:en-gb');
>>var r = prompt('How much is 2+2?','Done','Don`t know');
>>[these return the (perhaps empty) string entered or false]
>
> false for cancelling the prompt with close? What about null?

Not backwards compatible.

What do you mean by 'close'?

>>The arguments should be return any computed value.
>
> This does not parse. Do you mean that any value should be
> returnable? I would stick with character. Process the value if you
> need a different type.

Sorry, "caracter", do you mean "string"?

>>alert(array),confirm(array),prompt(array),
>>should be possible in all above cases.
>
> Good idea.
>
> There is one other thing. I want to be able to specify the
> default button.

One can never specify the default.

"Default" means "when not specified".

> There is quite a difference between
> Do you really want to print that report?
> and
> Do you really want to erase the entire database?
> It might be fine to default the first one to yes, but it would be
> horrible to do so for the second.

Sorry, that is up to the script programmer,
has nothing to do with my suggested improvements

> Yes, one can reverse the language, but then it often loses the

"reverse the language" like Hebrew, written in a "reversed" direction?

Perhaps you mean "reverse the question"
in the sense of affirmative/negative?

> clarity
> Do you mind erasing the entire database?
> "Erasing the entire database? ... No! ... ... Oh, NO!"

Perhaps "mind" as in "mind the child"?

A good system has ample backups.

Gene Wirchenko

unread,
Apr 5, 2012, 10:51:33 PM4/5/12
to
On 05 Apr 2012 22:37:10 GMT, "Evertjan."
<exjxw.ha...@interxnl.net> wrote:

>Gene Wirchenko wrote on 05 apr 2012 in comp.lang.javascript:
>
>> On 05 Apr 2012 08:12:32 GMT, "Evertjan."
>> <exjxw.ha...@interxnl.net> wrote:

[snip]

>> Why bother having a return value? alert() does not have one now.
>
>But it does, it defaults to not false, try it out.

I did with
alert(alert("Hi"));
I got an alert with "Hi" then one with "undefined". This was on IE 9.
All of my examples in this post were done under IE 9.

>There are no internal or defined functions without an implicit return
>value in javascript.
>
>Think it over, why should this crash?
>
>if (alert(1)) ...

It did not crash for me. I gave it an else clause, and that
clause was executed.

>>>var r = confirm('Are you quite certain?') // default;
>>>var r = confirm('Are you sure?','lan:default'); // default forced lang
>>>var r = confirm('Are you sure?','I am','No, I'm not');
>>>[these return true/false]
>>>
>>>var r = confirm('Are you sure?','I am','No, I'm not','Please
>>>explain'); var r = confirm('How much is 2+2?','7','4.2','2','Help
>>>me!'); [these return the string clicked,
>>>any number of choices>2, displayed vertically]
>>
>> I think that confirm() should be yes/no only. "confirm" means to
>> get OK or not and does not fit multiple choice. For multiple choice,
>> use something else. choose()?
>
>The powars are very conversative, If you let tham argue about a new name
>you loose valuable years.

ITYM "powers", "conservative", and "lose", but certainly
"conversative" will do. They will talk it to death.

>>>var r = prompt('How much is 2+2?'); // default
>>>var r = prompt('How much is 2+2?',lan:en-gb');
>>>var r = prompt('How much is 2+2?','Done','Don`t know');
>>>[these return the (perhaps empty) string entered or false]
>>
>> false for cancelling the prompt with close? What about null?
>
>Not backwards compatible.

But prompt() did return null for me.

>What do you mean by 'close'?

Clicking on the close button. That returns null for me as does
clicking on cancel.

>>>The arguments should be return any computed value.
>>
>> This does not parse. Do you mean that any value should be
>> returnable? I would stick with character. Process the value if you
>> need a different type.
>
>Sorry, "caracter", do you mean "string"?

Yes. Character data in the form of a string.
>
>>>alert(array),confirm(array),prompt(array),
>>>should be possible in all above cases.
>>
>> Good idea.
>>
>> There is one other thing. I want to be able to specify the
>> default button.
>
>One can never specify the default.

Yes, I can with message boxes for one.

>"Default" means "when not specified".

When not specified by the user, my specified choice will be made.

>> There is quite a difference between
>> Do you really want to print that report?
>> and
>> Do you really want to erase the entire database?
>> It might be fine to default the first one to yes, but it would be
>> horrible to do so for the second.
>
>Sorry, that is up to the script programmer,
>has nothing to do with my suggested improvements

It is a case of user-friendliness.

>> Yes, one can reverse the language, but then it often loses the
>
>"reverse the language" like Hebrew, written in a "reversed" direction?
>
>Perhaps you mean "reverse the question"
>in the sense of affirmative/negative?

As in reversing the question.

>> clarity
>> Do you mind erasing the entire database?
>> "Erasing the entire database? ... No! ... ... Oh, NO!"
>
>Perhaps "mind" as in "mind the child"?

No, as in "Do you if I smoke?"

>A good system has ample backups.

An even better system does not need them restored very often.

Sincerely,

Gene Wirchenko

Evertjan.

unread,
Apr 6, 2012, 3:22:13 AM4/6/12
to
Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:

>>But it does, it defaults to not false, try it out.
>
> I did with
> alert(alert("Hi"));
> I got an alert with "Hi" then one with "undefined". This was on IE 9.
> All of my examples in this post were done under IE 9.

Never touch the stuff.

>>There are no internal or defined functions without an implicit return
>>value in javascript.
>>
>>Think it over, why should this crash?
>>
>>if (alert(1)) ...
>
> It did not crash for me. I gave it an else clause, and that
> clause was executed.

So it was interpreted as not being false, so true.

If no return was given, the code woud crash/halt.

Gene Wirchenko

unread,
Apr 6, 2012, 12:14:29 PM4/6/12
to
On 06 Apr 2012 07:22:13 GMT, "Evertjan."
<exjxw.ha...@interxnl.net> wrote:

>Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:

>>Evertjan wrote:

>>>Think it over, why should this crash?
>>>
>>>if (alert(1)) ...
>>
>> It did not crash for me. I gave it an else clause, and that
>> clause was executed.
>
>So it was interpreted as not being false, so true.

Uh, no. On my system, the else clause is executed when the
expression is not true.

>If no return was given, the code woud crash/halt.

It returned undefined.

Sincerely,

Gene Wirchenko

Evertjan.

unread,
Apr 6, 2012, 3:54:56 PM4/6/12
to
Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:

> On 06 Apr 2012 07:22:13 GMT, "Evertjan."
> <exjxw.ha...@interxnl.net> wrote:
>
>>Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:
>
>>>Evertjan wrote:
>
>>>>Think it over, why should this crash?
>>>>
>>>>if (alert(1)) ...
>>>
>>> It did not crash for me. I gave it an else clause, and that
>>> clause was executed.
>>
>>So it was interpreted as not being false, so true.
>
> Uh, no. On my system, the else clause is executed when the
> expression is not true.

You are right here, my mistake.

>>If no return was given, the code would crash/halt.
>
> It returned undefined.

So?

undefined is a valid value in Javascript.

If no return was given, the code would crash/halt.

Gene Wirchenko

unread,
Apr 6, 2012, 4:09:10 PM4/6/12
to
On 06 Apr 2012 19:54:56 GMT, "Evertjan."
<exjxw.ha...@interxnl.net> wrote:

>Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:
>
>> On 06 Apr 2012 07:22:13 GMT, "Evertjan."
>> <exjxw.ha...@interxnl.net> wrote:

[snip]

>You are right here, my mistake.

Easy enough to get something reversed. That is why elsewhere I
state that I would like to be able to change defaults.

>>>If no return was given, the code would crash/halt.
>>
>> It returned undefined.
>
>So?
>
>undefined is a valid value in Javascript.

Yes, I know.

>If no return was given, the code would crash/halt.

How do you know? It could take a garbage value as well. It is
the sort of situation where the results are undefined (not the
JavaScript value). After all, if you do not play by the rules --
returning a value when you should -- you can not expect things to work
properly.

Sincerely,

Gene Wirchenko

Evertjan.

unread,
Apr 6, 2012, 4:23:01 PM4/6/12
to
Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:

>>undefined is a valid value in Javascript.
>
> Yes, I know.
>
>>If no return was given, the code would crash/halt.
>
> How do you know?

By testing:

if (foubar) z=3;
alert(z);

// Uncaught ReferenceError: foubar is not defined [chrome console]


> It could take a garbage value as well. It is
> the sort of situation where the results are undefined (not the
> JavaScript value).

"results undedined" is not the same as "no result returned".

I restate:

Any internal or defined function returns a javascript value,
like: 17, '17', true, undefined.


> After all, if you do not play by the rules --
> returning a value when you should -- you can not expect things to work
> properly.

As if a crach is proper working.

Dr J R Stockton

unread,
Apr 6, 2012, 4:20:00 PM4/6/12
to
In comp.lang.javascript message <75frn792kreqn0t372imt8u8pj3i60i5rl@4ax.
com>, Thu, 5 Apr 2012 08:51:18, Gene Wirchenko <ge...@ocis.net> posted:

>
> I think that confirm() should be yes/no only. "confirm" means to
>get OK or not and does not fit multiple choice. For multiple choice,
>use something else. choose()?
>

That's the hidden American in you leaking out. If writing for
expatriate compatriots, Yucca might prefer to give them kyllä/ei.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Eric Bednarz

unread,
Apr 6, 2012, 8:49:31 PM4/6/12
to
Dr J R Stockton <repl...@merlyn.demon.co.uk.not.invalid> writes:

> Gene Wirchenko <ge...@ocis.net> posted:

[...]

> That's the hidden American in you leaking out.

For chrissake, Gene; can't your hidden American leak out any better?

Gene Wirchenko

unread,
Apr 6, 2012, 10:48:36 PM4/6/12
to
On 06 Apr 2012 20:23:01 GMT, "Evertjan."
<exjxw.ha...@interxnl.net> wrote:

>Gene Wirchenko wrote on 06 apr 2012 in comp.lang.javascript:

[snip]

>> After all, if you do not play by the rules --
>> returning a value when you should -- you can not expect things to work
>> properly.
>
>As if a crach is proper working.

Straw man. I have made no such claim.

The code would not necessarily crash. It could give a garbage
result and possibly mess stuff up.

Sincerely,

Gene Wirchenko

Gene Wirchenko

unread,
Apr 6, 2012, 10:49:55 PM4/6/12
to
I did not know that I had one. The U.S.A. does not have a draft,
and there are no draftdodgers coming up here. (I am Canadian.)

Sincerely,

Gene Wirchenko

Mike Duffy

unread,
Apr 6, 2012, 11:02:26 PM4/6/12
to
Gene Wirchenko <ge...@ocis.net> wrote in
news:ioavn7d26pc9j1ktp...@4ax.com:

> (I am Canadian.)

That's North American, Gene. For Dr. Stockton, "English" means the dialect
spoken in a tiny country that would completely fit inside some of our
larger lakes.

--
http://pages.videotron.ca/duffym/index.htm

Gene Wirchenko

unread,
Apr 6, 2012, 11:38:06 PM4/6/12
to
On Sat, 7 Apr 2012 03:02:26 +0000 (UTC), Mike Duffy
<Use_guest...@website.in.sig> wrote:

>Gene Wirchenko <ge...@ocis.net> wrote in
>news:ioavn7d26pc9j1ktp...@4ax.com:
>
>> (I am Canadian.)
>
>That's North American, Gene. For Dr. Stockton, "English" means the dialect

That, too.

>spoken in a tiny country that would completely fit inside some of our
>larger lakes.

Uh, no. England is larger than any of the Great Lakes and Lake
Winnipeg. What other larger lakes are there?

Now, Hudson Bay is about nine times bigger than England.

Sincerely,

Gene Wirchenko

Mike Duffy

unread,
Apr 7, 2012, 12:09:21 AM4/7/12
to
Gene Wirchenko <ge...@ocis.net> wrote in
news:sbdvn757vko9p1qh3...@4ax.com:


>
> Uh, no. England is larger than any of the Great Lakes and Lake
> Winnipeg. What other larger lakes are there?

I didn't say say England is bigger than any particular lake. I said it
would fit into some of them. It looks like it would only take the two
largest:

Lake Superior: 82,100 km2
Lake Huron 60,000 km2
England 130,395 km2

And yes, I'm claiming ownership (as a North American) to these two lakes.

And I could not find a mean elevation for England, so it would not surprise
me if it would fit into Lake Superior. It has an average depth of 147m.

--
http://pages.videotron.ca/duffym/index.htm

John G Harris

unread,
Apr 7, 2012, 6:38:15 AM4/7/12
to
On Sat, 7 Apr 2012 at 03:02:26, in comp.lang.javascript, Mike Duffy
wrote:

<snip>
>That's North American, Gene. For Dr. Stockton, "English" means the dialect
>spoken in a tiny country that would completely fit inside some of our
>larger lakes.

"English" is an adjective meaning of or pertaining to England.

Therefore the English language is the language spoken in England. There
are minor differences between regions.

What's spoken by many people in North America is the language of
England, again with some differences. And government-sponsored
differences in spelling.

John
--
John Harris

Dr J R Stockton

unread,
Apr 7, 2012, 2:04:55 PM4/7/12
to
In comp.lang.javascript message <pqlsn7p6g2mu48sho8255uc7mjjri4kri5@4ax.
com>, Thu, 5 Apr 2012 19:51:33, Gene Wirchenko <ge...@ocis.net> posted:

>All of my examples in this post were done under IE 9.

In that case, perhaps you would care to look with IE9 at
<http://www.merlyn.demon.co.uk/uksumtim.htm#M4> (100kB).

Do you see a bluish area containing controls and a <canvas> diagram,
which changes when the radio-buttons are used? As loaded, with Both
set, does it match the smaller image below, after reading the adjacent
small paragraph? Are the green line and numbers consistent with your
location? Ignore minor text changes, and please don't send a screen-
shot.

I choose to not alter time and location settings on this PC, because of
other software that runs all the time on it.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
Website <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Dr J R Stockton

unread,
Apr 7, 2012, 2:14:13 PM4/7/12
to
In comp.lang.javascript message <15jun7968l8v7o03p6gsl8octbh0mloseg@4ax.
com>, Fri, 6 Apr 2012 13:09:10, Gene Wirchenko <ge...@ocis.net> posted:

>
> How do you know? It could take a garbage value as well. It is
>the sort of situation where the results are undefined (not the
>JavaScript value). After all, if you do not play by the rules --
>returning a value when you should -- you can not expect things to work
>properly.

The rules say that any exit from a function returns a value of type
undefined, which type has one value, defined as undefined, UNLESS the
exit was by way of a "return" statement including a value after the
"return" (needs to be on the same line), when that value (which may be
undefined) is returned.

That would be easier to say in Dutch, where some instances of undefined
would (I suppose) be written as onbepaald / ongedefinieerde / etc.; and
others not.

Dr J R Stockton

unread,
Apr 8, 2012, 2:34:59 PM4/8/12
to
In comp.lang.javascript message <XnsA02E19D64...@94.75.214.39>
, Sat, 7 Apr 2012 04:09:21, Mike Duffy <Use_guest...@website.in.si
g> posted:

>Lake Superior: 82,100 km2
>Lake Huron 60,000 km2
>England 130,395 km2

English is the language of the UK, 243,610 km2, from which one should
subtract an estimated quarter of 20,779 km2, for Welsh Wales, and a
little more for Gaelic Scotland. But you should include the Crown
Dependencies, 573 + 194 km2.

Mike Duffy

unread,
Apr 9, 2012, 10:56:17 AM4/9/12
to
Dr J R Stockton <repl...@merlyn.demon.co.uk.not.invalid> wrote in news:
$vKQS0DT...@invalid.uk.co.demon.merlyn.invalid:

> In comp.lang.javascript message <XnsA02E19D64...@94.75.214.39>
> , Sat, 7 Apr 2012 04:09:21, Mike Duffy <Use_guest...@website.in.si
> g> posted:

> English is the language of the UK, 243,610 km2, from which one should
> subtract an estimated quarter of 20,779 km2, for Welsh Wales, and a
> little more for Gaelic Scotland. But you should include the Crown
> Dependencies, 573 + 194 km2.

First, I should apologize for a bit of deception on my part. I checked
Wikipedia first, and I confused square miles for km2. I originally thought
that Lake Superior had more surface area than England, Scotland, and Wales
combined. Gene pointed out that I had made an error, but instead of
admitting it, I used a lack of specificity in my original statement to
support it anyway.

The point I was trying to make is that English is the "Lingua Franca" for
global technical treatise, and that the "proper" way to use it in this
venue is to keep the grammar simple and avoid idioms.

I do enjoy your manner of speaking, because it reminds me of several of my
favourite college professors who hailed from the UK. When I read your
postings, I can almost hear the accent.

--
http://pages.videotron.ca/duffym/index.htm

gow...@ezypro.com

unread,
Feb 26, 2014, 7:29:50 AM2/26/14
to
On Saturday, March 24, 2012 5:42:00 AM UTC+5:30, Larry....@gmail.com wrote:
> I have an alert that is displayed on an error. The second time the
>
> alert is displayed, it comes up with a checkbox that says "Prevent
>
> this page from creating additional dialogs". If this is checked the
>
> alert no longer gets displayed. How can I prevent that message so that
>
> the alert is always displayed?
tyjhfh

Denis McMahon

unread,
Feb 26, 2014, 4:30:17 PM2/26/14
to
That's a browser feature, it may be controllable through about:config
(and / or user preferences dialogs), in which case there may also be a
way to control it in javascript by setting the relevant variable, but
it's also possible that the variable is protected from being set execpt
through the about:config screen (and / or user preferences dialogs).

--
Denis McMahon, denismf...@gmail.com

nitesh...@ql2.com

unread,
Mar 27, 2015, 6:06:22 AM3/27/15
to

In Chrome browser You need to Restore settings to their original defaults.

anilku...@gmail.com

unread,
Jun 17, 2015, 3:31:53 AM6/17/15
to
Can any one of you please tell me what actually happens when user checks that prompt message not to display any more dialog box. Why I am asking this question is when user selects that box, from next time system not performing any action that was done before when it was displaying that pop-up message.

Your reply helps me a lot to understand this issue.

Thanks,
Anilkumar

anilku...@gmail.com

unread,
Jun 17, 2015, 3:33:06 AM6/17/15
to
On Saturday, March 24, 2012 at 5:42:00 AM UTC+5:30, Larry....@gmail.com wrote:
> I have an alert that is displayed on an error. The second time the
> alert is displayed, it comes up with a checkbox that says "Prevent
> this page from creating additional dialogs". If this is checked the
> alert no longer gets displayed. How can I prevent that message so that
> the alert is always displayed?

Erwin Moller

unread,
Jun 17, 2015, 8:11:17 AM6/17/15
to
It is a feature of Firefox (maybe other browsers) to prevent a webpage
from annoying users by creating a stream of alerts.

Try this:

<script type="text/javascript">
while (true){
alert("try to shut this page down!");
}
</script>

Such a script hijacks the browser, since it is close to impossible to
hit the close button before the new alert appears.


Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens

Ben Bacarisse

unread,
Jun 17, 2015, 8:27:11 AM6/17/15
to
It varies. Some browsers raise an exception and some do nothing at all.
If you find a way to remove or disable the checkbox, it will almost
certainly be considered a bug that will get fixed. In short, whatever
you are trying to do this way needs to be done some other way. There
are alternatives, but any specific advice rather depends on what you are
trying to do.

--
Ben.

Thomas 'PointedEars' Lahn

unread,
Jun 17, 2015, 5:28:37 PM6/17/15
to
Erwin Moller wrote:

> On 6/17/2015 9:31 AM, anilku...@gmail.com wrote:
>> Can any one of you please tell me what actually happens when user checks
>> that prompt message not to display any more dialog box. Why I am asking
>> this question is when user selects that box, from next time system not
>> performing any action that was done before when it was displaying that
>> pop-up message.
>
> It is a feature of Firefox (maybe other browsers) to prevent a webpage
> from annoying users by creating a stream of alerts.

It is a feature of all Mozilla-based software, including Firefox:

<http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow.cpp#6475>

--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

patel.c...@gmail.com

unread,
Nov 2, 2015, 12:46:52 AM11/2/15
to

Evertjan.

unread,
Nov 2, 2015, 3:59:37 AM11/2/15
to
patel.c...@gmail.com wrote on 02 Nov 2015 in comp.lang.javascript:

> you

Who is "you"?

Please quote on usenet where you are responding on!

You seem to be responding on a thread that ended 6 Apr 2012.

akilasar...@gmail.com

unread,
Feb 12, 2016, 4:19:29 AM2/12/16
to
0 new messages