Welcome Guest, Not a member yet? Register   Sign In
Getting iFrames to talk back to each other?

Hello there.

I'm using thickbox.js to get iFrames nicely popping up for certain things in my apps. Like, for example, when deleting something on the page, I'm wanting it to call a 'remove' controller that will show it's views in the popup iframe using the thickbox. Hopefully with this, I can make it compatible with people who don't have Javascript? so the normal controller will be called standard if no javascript is present. This is the idea anyhow.

My URLs are looking like this from the example remove button in my list:

This does seem to work fine (with no configuration changes, it seems)

But the problem I'm not having is what the controller should do once the user has, for example, clicked the 'Yes I want to remove this' in the 'remove' controller's view. As, at the moment, it continues to load the success page in the thickbox's iFrame. Which really isn't what I want here...

ideally, when I've clicked 'yes' in the remove controller's view, inside that iFrame, i want it to send some AJAX back to the page underneath, so to update the list instantly with 'this item has been deleted'. But to get the iFrame and the page below to talk to each other? And not only that, having it also work when there is no javascript enabled?

What am I'm needing to know to make this happen? If at all?

Thanks guys!

[eluser]Chalda Pnuzig[/eluser]
I try...

In your iframe you must insert
<button on click="parent.myFunction()">Yes</button>

when myFunction is the js function of parent page.

Theme © iAndrew 2016 - Forum software by © MyBB