Opened 12 years ago
Closed 12 years ago
#9195 closed bug (invalid)
Calling on $('#<domID>') within an iFrame fails
Reported by: | anonymous | Owned by: | anonymous |
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | misc | Version: | 1.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'm developing a Facebook app at the moment using jQuery 1.6. The facebook app interphace reequires that your app runs within an iFrame on facebook.
In this case, jQuery within the iframe fails to get DOM elements within the iFrame using $('#<domID>'), it returns null. My guess is that jQuery by default searches for dom elements at the parent level/top frame.
Example
<html> <head></title>This is facebook</title></head> <body> <iframe src="http://example.com/yourapp.html">
<html>
<head>
<title>My App</title> <script type="text/javascript">
$.checkDom = function() {
alert($('#someobj')); NULL
}
</script>
</head> <body>
<input type="text" id="someobj" value="hello" onclick="$.checkDom()" />
</body>
</html>
</iframe> </body> </html>
Change History (2)
comment:1 Changed 12 years ago by
Component: | unfiled → misc |
---|---|
Owner: | set to anonymous |
Status: | new → pending |
comment:2 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
would help if you actually included jQuery in your iframe doc