Re: prompt not working
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: prompt not working

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Wed Nov 30 2005 - 23:28:17 CET

Thomas 'PointedEars' Lahn wrote:

> joemac wrote:
>> Thomas 'PointedEars' Lahn wrote:
>>> 2. Therefore, a ReferenceError occurs and further expressions
>>> are not evaluated.
>>
>> Is it possible to determine that this (ReferenceError) has occurred,
>
> Yes, if the error reporting feature of your UA does not suffice,
> you could use
>
> try
> {
> // statements that may cause errors
> }
> catch (e)
> {
> alert(e.name + ": " + e.message);
> }
>
> provided it is supported (ECMAScript 3 compliant implementation).
> Or use proprietary
>
> onerror = function()
> {
> alert("Error!");
> onerror = null;
> return true;
> }

Thinking about it, if prompt() does not work, alert() may not work either,
as both are methods of the Window host object and not built-in language
features.

Maybe you will have to find other ways to indicate error. You could change
the value of a variable, for example. Comparison will at least indicate
that there was an error. I think, _which_ error occured cannot be easily
determined without using AOM/DOM features.

PointedEars
Received on Sat Dec 3 04:34:10 2005