Quantcast
Viewing latest article 9
Browse Latest Browse All 51

Answer by Scotsman for How to redirect one HTML page to another on load

I found a problem while working with a jQuery Mobile application, where in some cases my Meta header tag wouldn't achieve a redirection properly (jQuery Mobile doesn't read headers automatically for each page so putting JavaScript there is also ineffective unless wrapping it in complexity). I found the easiest solution in this case was to put the JavaScript redirection directly into the body of the document, as follows:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="refresh" content="0;url=myURL" /></head><body><p>You are not logged in!</p><script language="javascript">            window.location = "myURL";</script></body></html>

This seems to work in every case for me.


Viewing latest article 9
Browse Latest Browse All 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>