Log in

View Full Version : Alternative to onload?



mvogel
03-29-2008, 04:46 AM
I've built a page that has an iframe. Although both pages are served from the same domain, I only have access to the page which has the iframe and not the page in the iframe. I've written javascript to change styles and do redirects in the iframe - everything works.

In one of the iframe pages, when you click on the submit button, I want to redirect the returned page to another page of my choosing. I have written an onload event which changes the src of the iframe. However, for a split second you can see the page that the the submit returned before the page is redirected. I want to avoid the user seeing that other page even for a split second.

Other than calling the redirect javascript from an onload event, is there another event I can use to avoid seeing the other page?

Nile
03-30-2008, 02:49 AM
Can we please see your code?

mvogel
03-30-2008, 03:56 AM
function chgpage() {
var iframeurl
= (iframeForm2.location.href);
var logurl = 'https://system.netsuite.com/core/media/media.nl?id=555&c=772390&h=18c090612029edad6b17&_xt=.htm';
if (iframeurl == 'https://system.netsuite.com/pages/customerlogin.jsp?country=US')
{document.getElementById('iframeForm2').src = logurl;}

}




<iframe id="iframeForm2" name="iframeForm2" src=" https://system.netsuite.com/core/media/media.nl?id=555&c=772390&h=18c090612029edad6b17&_xt=.htm" width="100%" height="1000" align="top" frameborder="0" scrolling="no" onload="chgpage();"> </iframe>