1

I have a web page that has a DIV and an IFRAME. When a user clicks a button in my DIV, I need to submit the web form that is hosted in my IFRAME. Both pages are hosted on the same server in the same directory. My code that attempts to submit the web form looks like this:

$("#myIFrame").contents().find("form").submit();

When this code is called, I receive an error in IE that says: "Internet Explorer cannot display the webpage"

In FireFox when I execute the code, I receive an error that says: "The connection was reset"

In FireFox when I look at the error console I see: "Error: Permission denied for http://localhost:2995 to get property HTMLDocument.nodeType from ."

What am I doing wrong?

asked May 3, 2010 at 20:16
1
  • 1
    Are the pages hosted on the same port? Commented May 3, 2010 at 20:20

1 Answer 1

1

I made a short test using the frameReady plug-in:

$("#extsumbit").click(function(event){
 $.frameReady(function(){
 $("#frameform").submit();
 }, "top.myiframe");
});

This way you can access the content inside the iframe transparently using jQuery selectors.

answered May 3, 2010 at 21:34
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.