tags:

views:

42

answers:

2

Hi,

I need to redirect to another page when the client script is disabled on the browser. Can anyone please help?

Thanks

+3  A: 

I haven't tested this but it should work.

Content inside <noscript> fires when there is no Javascript enabled, so you can do a <meta /> redirect like this.

<noscript>
    <meta http-equiv="refresh" content="0; URL=path-to-no-js-page.html"">
</noscript>
Marko
it says meta cannot be nested within noscript!
Yeah I've heard that the validator might complain about it before. Make sure you're placing it in the <head> of your page.
Marko
ok.. so confusing.. tried to put within the head element and outside the body element. I got error: noscript cannot be nested within element head!.When I placed within the body element, the noscript will never get a chance to be triggered because all the javascript was placed executed within the head element so it gives an script error first
@user384080 - Where are you getting these errors?
Marko
Message: ASP.NET Ajax client-side framework failed to load.Message: 'Sys' is undefined
huh? Because of `<noscript>`? What happens in the other browsers?
Marko
ok.. here what I put in the master page (within body element): <NOSCRIPT> <meta http-equiv="Refresh" content="3; URL=../noscript.aspx"> </NOSCRIPT>. but it didn't redirect to noscript page
@user384080, what about placing it in the `<head>` element?
Marko
placing in the head will give me an error: noscript cannot be nested within element head
it's actually working place it in the head element. but i don't know why VS 2010 giving the intellisense error: noscript cannot be nested within element head