Javascript about to be disabled event

L

Luke Yan

but if javascript is disabled, there will be no events any more. :)

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

thanks
luke
 
J

Jeremy J Starcher

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.
 
S

Swifty

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.

--
 
L

Lasse Reichstein Nielsen

Swifty said:
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
 
D

Dr J R Stockton

In comp.lang.javascript message <27e65092-da38-4a6a-a332-1f777cf15e87@h6
0g2000hsg.googlegroups.com>, Tue, 30 Sep 2008 22:39:45, Swifty
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.
 

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

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,351
Latest member
LolaD32479

Latest Threads

Top