469,345 Members | 6,515 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,345 developers. It's quick & easy.

Javascript about to be disabled event

Is there an event which is triggered when JavaScript is about to be
disabled?

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Sep 29 '08 #1
5 2505
but if javascript is disabled, there will be no events any more. :)

while the tag "<noscript>" will be rendered under such case

thanks
luke

Steve Swift wrote:
Is there an event which is triggered when JavaScript is about to be
disabled?

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Sep 30 '08 #2
On Mon, 29 Sep 2008 17:40:11 -0700, Luke Yan wrote:
but if javascript is disabled, there will be no events any more. :)

while the tag "<noscript>" will be rendered under such case

thanks
luke
not always. Some times Javascript is filtered out at the firewall while
the browser itself does have Javascript enabled.

Thus, no Javascript and yet, no "<noscript>" processing.
Sep 30 '08 #3
On 30 Sep, 01:40, Luke Yan <gumpag...@gmail.comwrote:
but if javascript is disabled, there will be no events any more. :)
Ah, but it isn't disabled yet, but it soon will be, hence "about to
be". The user has told the browser to disable Javascript, but it
hasn't disabled it yet.

In my webpage, a few controls have been disabled by previous
Javascripted events. If the user now disables Javascript, they will no
longer be able to use the page fully, as if it had been loaded with
JavaScript disabled, so I'd like there to be an event which the
browser triggers, which runs my "about to be disabled" code, then it
disabled Javascript.

Unfortunately, I don't think there is such an event.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Oct 1 '08 #4
Swifty <St***********@gmail.comwrites:
On 30 Sep, 01:40, Luke Yan <gumpag...@gmail.comwrote:
>but if javascript is disabled, there will be no events any more. :)

Ah, but it isn't disabled yet, but it soon will be, hence "about to
be". The user has told the browser to disable Javascript, but it
hasn't disabled it yet.
My guess is that that event is so rare that nobody has bothered
worrying about it.
If someone has Javascript disabled, they usually has it disabled
all the time. New pages are loaded with Javascript off.
In my webpage, a few controls have been disabled by previous
Javascripted events. If the user now disables Javascript, they will no
longer be able to use the page fully, as if it had been loaded with
JavaScript disabled, so I'd like there to be an event which the
browser triggers, which runs my "about to be disabled" code, then it
disabled Javascript.
People disabling Javascript on a running page expect things to break.
They'll just have to reload the page.
Unfortunately, I don't think there is such an event.
Neither do I, although I don't think it's unfortunate. It would create
an expectation that pages should be able to adapt to scripting being
disabled, which isn't really reasonable.

/L
--
Lasse Reichstein Nielsen
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Oct 1 '08 #5
In comp.lang.javascript message <27e65092-da38-4a6a-a332-1f777cf15e87@h6
0g2000hsg.googlegroups.com>, Tue, 30 Sep 2008 22:39:45, Swifty
<St***********@gmail.composted:
>On 30 Sep, 01:40, Luke Yan <gumpag...@gmail.comwrote:
>but if javascript is disabled, there will be no events any more. :)

Ah, but it isn't disabled yet, but it soon will be, hence "about to
be". The user has told the browser to disable Javascript, but it
hasn't disabled it yet.
Rather than expecting JavaScript to be formally disabled while the page
is being viewed - and is there a guarantee that all browsers will make
that effective on the current page, rather than just reading the bit at
page load - why not make all event handlers equivalent to "return false"
(insert "if (NoScript) return false;" in each) or, if possible, put a
transparent div over everything that will catch the events? You can
then, if wished, allow one particular event to enable the others.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL: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)
Oct 1 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by horos | last post: by
26 posts views Thread by wardy | last post: by
10 posts views Thread by jason_box | last post: by
6 posts views Thread by drec | last post: by
24 posts views Thread by firstcustomer | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.