Jump to content

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


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. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.