Skip to content Skip to sidebar Skip to footer

Click Event In Iframe

I'm trying to append the url of the parent page an iframe is located in based on the current url within the iframe. This is all taking place on the same domain, so I don't think th

Solution 1:

Did you try:

document.getElementById("dealer-locator").contentWindow.onload = locator_url;

Solution 2:

Well, if you need click events in your iframe, then you could do it this way:

<a href="http://www.car.com" onClick="parent.locator_url(); return false;">Car.com</a>

Then locator_url() gets called in the parent page. Same goes for using load events (I mean, load events that occur in the iframe context).


Post a Comment for "Click Event In Iframe"