Forum Moderators: open

Message Too Old, No Replies

Do I need the <noscript>?

         

Emperor

11:27 pm on Nov 3, 2004 (gmt 0)

10+ Year Member



Hi guys,

Let's say I have this:

<input ... onfocus="MyFocus()">

Do you think I should make two versions, like this:

<script>
document.write(the above string to make the input box)
</script>

<noscript>
<input ...(no JavaScript functions)>
</noscript>

When I turn off JavaScript in Firefox it just ignores the functions like onfocus() and still makes the control, but maybe it's different in other browsers?

Take care,
Cyrus

johnl

11:18 am on Nov 5, 2004 (gmt 0)

10+ Year Member



www.w3.org/TR/html4/interact/scripts.html#idx-script says:

"Scripts that appear within a SCRIPT element are executed when the document is loaded. For user agents that cannot or will not handle scripts, authors _may_ include alternate content via the NOSCRIPT element."

So according to the spec it seems to be up to you.
It might be wise though to include the <noscript>, as in the example of the same spec:

<SCRIPT type="text/tcl">
...some Tcl script to insert data...
</SCRIPT>
<NOSCRIPT>
<P>Access the <A href="http://someplace.com/data">data.</A>
</NOSCRIPT>

adni18

12:30 pm on Nov 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The newest version of IE has an 'information bar' which annoyingly blocks all the javascripts on the page until the user specifies not to.

Emperor

4:02 pm on Nov 5, 2004 (gmt 0)

10+ Year Member



Hi,

Yeah, I guess I'll be complete and use the <noscript>, it can't hurt and isn't much extra effort.

adni18, that setting in IE6 is on by default only for local pages (pages on your own computer), it's a good idea to turn that off.

Take care,
Cyrus