noscript tag

They have: 59 posts

Joined: Mar 2000

Hi: I am trying to use <noscript> to give alternate information to a browser that doesn't have JavaScript. It was my understanding that browsers that don't recognize scripts would ONLY display the noscript section. However, if I turn off JavaSCript, I get both the noscript section and the rest of the page (minus whatever it can't figure out how to display). Do I just have the definition of <noscript> wrong? Or does it have something to do with the <body> tags? Does <body> go inside <noscript>, outside it, or in both places? Phyllis

They have: 89 posts

Joined: Sep 1999

from what I understand about this, <noscript> should come immediately after the script for which it is providing alternate content...

it would be easier to comment out the javascript using something like

<!-- to hide script contents from old browsers
function square(i) {
document.write("The call passed ", i ," to the function.","<BR>")
return i * i
}
document.write("The function returned ",square(5),".")
// end hiding contents from old browsers -->

I THINK noscript functions as sort of a wierd if/else statement. I.e. if the have javascript, display a random link or if they don't..display a static link..something like that..I'm not sure that it could be used the way you are attempting. However, I could be completely wrong. Heh.

They have: 59 posts

Joined: Mar 2000

My problem is that much of my page is dynamically written. So without Javascript enabled, you don't get the text of the article. I had thought <noscript> worked like <noframes> but I guess I'm mistaken. I do comment out the scripts, but I need to stick in an alternate somewhere. I'll just try interspersing <noscript> tags, but it seems weird to me that the definition I had for <noscript> was completely wrong. I was using this defintion:

quote:Browsers that support scripts ignore everything between the NOSCRIPT and /NOSCRIPT tags; on the other hand, browsers that do not support scripts ignore everything except what is in the NOSCRIPT section. In this way, you can create two documents in one: one that uses scripts, and a second for simple browsers.

That comes from an HTML Catalog I got online. I guess it's just wrong though. Oh well. Phyllis

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.