PDA

View Full Version : iframe does not load from external links



sanins
03-12-2008, 08:58 PM
How do I link directly to the page that contains my iframe?

When linking from an external page or email link - the iframe will not load -at the same time - the links that should change the iframe do not work.

However, when navigating from the website homepage - the iframe will load, as well as the links on the page.

Please try this link and let me know what I'm missing:

http://www.ncisupplierservices.com/testimonials.htm

Thank You!

Bob90
03-13-2008, 04:19 PM
Do you mean you load a different website that display your website?
Does anything display instead of the iframe?

sanins
03-13-2008, 04:27 PM
Thanks for replying . . .

If you click on the link above, the iframe should appear on the right hand side of the page above the menu bar with - contact us, testimonials, documents.

The iframe url's are from my site and not an external web site. I was hoping to send out an email with links directly to testimonials and have the iframe load correctly.

Nothing is displayed when linking from an email or external link.

Bob90
03-13-2008, 04:37 PM
Try adding this to your iframe pages.


window.onload = function() {
if (top.location != self.location) //if this window is the only one (there is no 'top' window')
top.location = "http://www.ncisupplierservices.com/testimonials.htm";
};


Let us know if it works :)

sanins
03-13-2008, 05:08 PM
I added the above code to iframe page (consorta.htm) - unfortunately the page kept trying to load and reload.

Bob90
03-13-2008, 05:24 PM
whoops,

try this


window.onload = function() {
if (top.location == self.location) //if this window is the only one (there is no 'top' window')
top.location = "http://www.ncisupplierservices.com/testimonials.htm";
};

sanins
03-13-2008, 05:32 PM
Ok . . . page stopped trying to reload, however, the iframe is still blank.

I'm assuming this code should go in the head section of the iframe page consorta.htm?

sanins
03-13-2008, 05:41 PM
On a good note . . . the iframe links now work when accessing the page from an external link! Thank you!

Now . . . If the page would load the default iframe, I would be in great shape.