views:

24

answers:

2

We have a scenario where our iframe loads external src. There could be url response error. Since we are unableto read the response code we are unable to stop the processing. We have a code some thing similar to

We should not be using ajax since we face some issues with cross domain functionalities

Please help....

+1  A: 

Just use a cross-domain server-side proxy and pass the uri with Javascript, then read the response of that.

meder
A: 

Are you wanting to pass responses from the iframe to the main window?

// javascript Class in Main Window MyClass = { response : function (msg) { alert("Response:"+msg); } }

// Response in iFrame window.top.MyClass.response("Good");

woodscreative
Cross domain frames can't communicate between each other (except from setting their locations).
Alin Purcaru
We are hitting external url using Iframe src="" we dont have an option of invoking using ajax call since we are facing issues with cross domain ajax call functionalities. But when we invoke the external url, we might not be getting any response from the external source for a long time and hence the iframe component does not load. We get 404 error in the Iframe but on the main window we dont know how to look at the iframe if it generates 404 error. Can you please provide me a sample code to find the same