Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-28-2012, 09:47 PM   PM User | #16
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,449
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by ksz View Post
I would like to try it, but I need to know:
1- What goes in "http://example.com/"
Whatever page you want it to replace the current page with.

Quote:
Originally Posted by ksz View Post
2- Which goes first:
document.documentElement.write('<meta http-equiv="X-UA-Compatible" content="IE=edge" />')
then
document.write('<meta http-equiv="refresh" content="'+time+'; url=http://example.com/">')
or the other way?
The refresh isn't going to reload the page immediately even if you specify a time of zero so it can go second.

Quote:
Originally Posted by ksz View Post
3- What does "refresh" really do? Does it reload the page's code, by reading the code from its source again, or just refreshes the screen based on the already loaded code?
It loads a completely different page in place of the current one. You can't use it to reload the current page as that would create an infinite loop.

One other thing to note is that the http-equiv refresh can be disabled in the browser so not everyone will be transferred to the next page. If you use the http location header to do the redirect to the new page instead then it can't be disabled in the browser and the current page doesn't need to be sent to the browser at all.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:37 AM.


Advertisement
Log in to turn off these ads.