ev66 Posted March 26, 2007 Share Posted March 26, 2007 I want 2 pages to load one after the other into a frame,How do I force the browser to finish loading the first page before it goes onto load the second ?function myfunc() {parent.rightFrame.location.href="http://www.google.co.uk/";parent.rightFrame.location.href="http://news.google.co.uk/"}Thanks Link to comment Share on other sites More sharing options...
aspnetguy Posted March 26, 2007 Share Posted March 26, 2007 use the frame onload event to trigger the second load Link to comment Share on other sites More sharing options...
ev66 Posted March 26, 2007 Author Share Posted March 26, 2007 but what if i have numerous pages parent.rightFrame.location.href="http://www.google.co.uk/page1.html"; then parent.rightFrame.location.href="http://www.google.co.uk/page2.html"; then parent.rightFrame.location.href="http://www.google.co.uk/page3.html"; thenetc Link to comment Share on other sites More sharing options...
aspnetguy Posted March 26, 2007 Share Posted March 26, 2007 what is the point of loading a page and instantly changing it to something else? Link to comment Share on other sites More sharing options...
ev66 Posted March 26, 2007 Author Share Posted March 26, 2007 I want to use innerHTMl to get a list of prices, but I need to load page into frame first for innerHTML to work. Link to comment Share on other sites More sharing options...
aspnetguy Posted March 26, 2007 Share Posted March 26, 2007 This will not work if these sites are not in the same domain as yours. JavaScript cannot access any site out side it's own domain. Link to comment Share on other sites More sharing options...
iyeru42 Posted March 26, 2007 Share Posted March 26, 2007 Not only that, but even if you had internal pages... you can't force a page to load all the way if you use any media such as MP3s and Flash Documents that are embedded (Because embeds load even after the page reports that it is "Done." Take youtube for example.) Link to comment Share on other sites More sharing options...
aspnetguy Posted March 26, 2007 Share Posted March 26, 2007 you can use window.onload (not document.body.onload) to wait until all media is loaded (I think, at least images). Link to comment Share on other sites More sharing options...
iyeru42 Posted March 26, 2007 Share Posted March 26, 2007 You could also use the embeds[] DOM array if I'm thinking correctly, but I don't think it has a load event. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now