Reputation: 68902
What i am doing is a new image uploader, i want to put the input file in the iframe and show the uploaded images in the parent page. So how can i access the parent elements from the inner iframe? or if some one have an example, that will be nice as well.
Upvotes: 0
Views: 1309
Reputation: 12423
http://groups.google.com/group/jquery-en/browse_thread/thread/6a8ffe14ba525ccb
Works in FireFox.
Upvotes: 0
Reputation: 46415
Frame object .parent will allow you to access the outer, or even document.top. If the two pages are not on the same domain your browser will likely block the script execution as an XSS attack.
Upvotes: 2
Reputation: 117220
I dont think you can, else I could just inject my IFRAME into your page, and go ape. From a security point of view.
Upvotes: 0
Reputation: 4749
You have limited options since iframes are not compatible browser-wide.
If you really stick to it, you can have it done only via server-side. JavaScript handles iframes incorrectly in many contexts, it is insecure, uncertain and doubtedly.
If you are open-minded enough, check out Ajax frameworks to change your uploading iframe into a smooth and effective uploader.
If you're interested in the latter, examples might be available on the air.
Upvotes: 0