0

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....

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

I'm not the OP but I have this same problem. I can't pass the URI because it's dynamically generated from the page within the iFrame document. (It's doing AJAX grid callback stuff.) Is there a way to retrieve this (this is psuedocode, i'm aware): window.iframe.document.httpStatus ?
0

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");

2 Comments

Cross domain frames can't communicate between each other (except from setting their locations).
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.