The Little Guy Posted July 21, 2009 Share Posted July 21, 2009 is it possible for an iframe to run a JavaScript function in the main window? I want to place an upload field in the iframe, and when the iframe uploads the photo, I would like it to run an ajax function in the main window once the iframe reloads back to its main state displaying the upload field. Link to comment https://forums.phpfreaks.com/topic/166746-solved-iframe-run-function-on-main-window/ Share on other sites More sharing options...
dzelenika Posted July 21, 2009 Share Posted July 21, 2009 Why iframe? Why don't You use a div instead of iframe? Link to comment https://forums.phpfreaks.com/topic/166746-solved-iframe-run-function-on-main-window/#findComment-879284 Share on other sites More sharing options...
The Little Guy Posted July 21, 2009 Author Share Posted July 21, 2009 Why iframe? Why don't You use a div instead of iframe? Because: - I can create an Ajax upload effect - I don't have to reload the entire page a second time, just the upload form. Link to comment https://forums.phpfreaks.com/topic/166746-solved-iframe-run-function-on-main-window/#findComment-879288 Share on other sites More sharing options...
dzelenika Posted July 21, 2009 Share Posted July 21, 2009 OK. It is posiiible try: window.top.window.mainWindowFunctionName(....) from IFrame Link to comment https://forums.phpfreaks.com/topic/166746-solved-iframe-run-function-on-main-window/#findComment-879297 Share on other sites More sharing options...
The Little Guy Posted July 21, 2009 Author Share Posted July 21, 2009 Perfect Thanks! Link to comment https://forums.phpfreaks.com/topic/166746-solved-iframe-run-function-on-main-window/#findComment-879724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.