iframe loading thoughts

Associate
Joined
16 Feb 2008
Posts
307
Location
Staffordshire
Ok, before we begin I know all about the Iframe arguments, wether to use or not etc but I have no choice in this project.

scenerio: I will keep it simplistic to avoid confusion.

for instance I have "page1.html" with a menu.
I have "page2.html" with an iframe within a div.

problem:

Easy enough to load external pages into the iframe from separate pages via menu on the page or another page using seperate .html pages, but means producing lots of replica pages with just the iframe displaying different content.

Now I would like to use just "page2.html" exclusively and load different content into the page using the menu on "page1.html".

MOST IMPORTANTLY the content in the iframe is loading from an external domain. This is why I had problems in jquery etc due to security issues.

I m sure there is some javascript out there to do just this, googling proved futile as a lot of the info is 5 years out of date.

any help appreciated.
 
Associate
Joined
19 May 2003
Posts
1,375
Location
Saltaire, West Yorkshire
Unless you control both domains it will not be possible as that would be XSS (Cross site scripting) and is a security risk. However if you do control both domains you can have the content inside the iframe call JavaScript from the parent window, but only if you control both domains :)

Other option will be AJAX and sounds more like the real solution.
 
Associate
OP
Joined
16 Feb 2008
Posts
307
Location
Staffordshire
Yeah,

thought XSS would be problem.

Seems I should just choose the copy and paste option, just looks untidy though, it does the job I suppose.
Initally I was going down the php/ jquery route but came across XSS issues there too.

thanks for replying and confirming the info though, appreciated.
 
Back
Top Bottom