1

is there way to reload a web-page, when javascript is disabled in the brwoser?

I mean, if the user visits the page first time, and has no javascript enabled, the page reloads with a get parameter like page.php?js=false.

Maybe, thanks for hints.

1
  • it is impossible to do reload iof javascript is enabled ? on page.php?js=true - and remember it in session ? Commented Feb 18, 2011 at 15:55

4 Answers 4

3

The only way you could force a page reload, without javascript, is by use of a meta refresh tag. However, this is the wrong way to go: better display that page for the javascript-deprived, and redirect those who DO have javascript to a more appropriate page instead.

Sign up to request clarification or add additional context in comments.

6 Comments

I was thinking the same thing, basically the OP just needs to do the opposite of what hes thinking.
You run into race conditions - the meta redirect could fire before external javascript finishes loading, and get a false redirect because the not-yet-loaded javascript failed to kill the redirect.
ok, thats a point. and google does not like the meta-refresh tag?
Don't know, offhand. I leave the SEO worries to others. There's plenty of legitimate reasons for meta refresh, though, so I can't see Google penalizing its use.
How can you kill the redirect with javascript?
|
3
<noscript>
  <meta http-equiv="refresh" content="2;url=page.php?js=false" /> 
</noscript>

You can use <noscript> tag with refresh <meta> tag.

3 Comments

@Ilyssis: I am not sure about Google :)
btw. one content-tag too much
@Ilyssis: Fixed did not notice that. Note that 2 is time in seconds, you can adjust that.
1

Adding to Sarfraz's post, you could do this, to match your request:

<noscript>
    <meta http-equiv="refresh" content="2;url=page.php?js=false">
</noscript>

Comments

0

You can do it the other way around:

Assume javascript is not available, and redirect using javascript to page.php?js=true.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.