Bug Tracker

Opened 10 years ago

Closed 10 years ago

#13742 closed bug (notabug)

jQuery.parseHTML() - "context" argument not working

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

The following scenario not working:

<form id="main">
</form>

<script>
    var elems = jQuery.parseHTML("<input>", document.getElementById("main"));
    $("#main").append(elems);
</script>

Error is thrown because the function createElement() is called on "Node" object (not "document"). In case of more complex HTML function createDocumentFragment() on "Node" object is called. In short, expected only "document" object.

What does the argument "context"? In what scenario it can be useful? As I understand the documentation, result should be added to the "context" after method call in any case.

Change History (1)

comment:1 Changed 10 years ago by timmywil

Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.