• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting iFrames to talk back to each other?

#1
[eluser]littlejim84[/eluser]
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:
http://localhost/web/index.php/remove/event/28?TB_iframe=true&height=200&width=300

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!

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


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

when myFunction is the js function of parent page.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.