Bug Tracker

Opened 10 years ago

Closed 10 years ago

#4256 closed bug (invalid)

Can't create iframe with jQuery('html)

Reported by: kNard76 Owned by:
Priority: undecided Milestone: 1.4
Component: core Version: 1.3.2
Keywords: contents Cc:
Blocked by: Blocking:

Description

Hello, I explain my problem, when i execute this code on Mozilla there is no error, but on Internet explorer return this error : "Objet requis" (Internet explorer in French) And this error appears in this command : "alert($("#crtlSdiv").contents().find("body").length);" But when i put this command there is no error : "$("#crtlSdiv").contents()"

Change History (2)

comment:1 in reply to:  description Changed 10 years ago by kNard76

Replying to kNard76:

Hello, I explain my problem, when i execute this code on Mozilla there is no error, but on Internet explorer return this error : "Objet requis" (Internet explorer in French) And this error appears in this command : "alert($("#crtlSdiv").contents().find("body").length);" But when i put this command there is no error : "$("#crtlSdiv").contents()"

For more information i create my iframe with jQuery command

comment:2 Changed 10 years ago by brandon

Resolution: invalid
Status: newclosed
Summary: Problems with the function contents on Internet ExplorerCan't create iframe with jQuery('html)

The issue is that the iframe hasn't completely been loaded by IE yet. You'll need to use the onload event of the iframe before trying to use its contents.

Note: See TracTickets for help on using tickets.