2

Yes , It's a similar question as in here , but mine is tagged with jquery.

in short : I have this scenario :

enter image description here

both documents (x.B.com and y.B.com) has document.domain="B.com";

But lets say Im in y.B.com and I want to execute work()

Running parent.frames['if1'].work(2); -- is working.

But I tried doing it with jQuery : (didn't succeed)

  • $('#if1', parent.document).contents().work(2);

  • $('#if1', parent.document)[0].work(2);

How can I do it ?

0

1 Answer 1

2

If you can do it without jQuery, the amount of text you need to type is less without jQuery, and the code is easier to understanding without jQuery, then why use jQuery?

jQuery can't traverse a document from a different domain.

this was failed :

$('#if1', parent.document)...

while this was OK

parent.frames['if1']....

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

1 Comment

The answer is you can't because jQuery can't traverse a document from a different domain.

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.