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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 21, 2009 Author Share Posted July 21, 2009 Perfect Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.