Jump to content

same domain: pass onclick event to iframe page containing the script?


antonyfal

Recommended Posts

Hi,

is it possible and how to do it. I have a onclick="reference to a function" on my parent page. The script for the function on a page located in an iframe. I have control over the domain path..

 

The onclick looks like this:

 

<a href="javascript:void(0);" onlick="javascript:chatto('50' ,'john doe');"></a>

the page can have several links located arround the page with different user names and id's..

 

the script is located on an iframe page:

<iframe src="chat.php"></iframe> the chat.php includes the chat.js file.

 

is this possible and how can i achieve this?

if it is indeed on the same domain, you can reference it with the parent object: window.parent.someFunction.  If the parent window and iframe window do not share the same domain, then it is not possible, as this is cross-site-scripting. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.