Bug Tracker

Modify

Ticket #3737 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

TypeError: ret[i].parentNode is null

Reported by: malsup Owned by: flesler
Priority: major Milestone: 1.3
Component: core Version:
Keywords: Cc: malsup
Blocking: Blocked by:

Description

TypeError occurred at line 1017 of 1.3b1 while using Taconite plugin to inject a script element into the document head.

This screenshot shows the error in Firebug:  http://jquery.malsup.com/test13/test-taconite.png

Test page here:  http://localhost:8888/malsup/test13/test-taconite-1.3b1.html

Same test using 1.2.6:  http://localhost:8888/malsup/test13/test-taconite-1.2.6.html

I tried for quite a while to prepare a small test case but couldn't seem to get the same error to occur without using Taconite. :-(

Change History

comment:2 Changed 4 years ago by dmethvin

  • need changed from Review to Patch
  • Owner set to flesler

The problem only occurs if a script DOM element is passed into jQuery.clean:

  $(document.createElement("script")).appendTo("head");

The script processing at line 994 only happens if the incoming argument is a string; it needs to be moved outside that test ... er, somehow. :-)

comment:3 Changed 4 years ago by flesler

  • Cc malsup added
  • need changed from Patch to Commit
  • Status changed from new to assigned

comment:4 Changed 4 years ago by flesler

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed at [6004].

comment:5 Changed 4 years ago by Leeoniya

  • Status changed from closed to reopened
  • Resolution fixed deleted

broken again in b2 :(

comment:6 Changed 4 years ago by malsup

I created a simpler test case for this. The problem is in the assumption that a script element has a parent node. This is not true for script elements that have been created but not inserted into the DOM.

 http://jquery.malsup.com/test13/test-script-1.3b2.html

comment:7 Changed 4 years ago by john

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed in SVN rev [6078].

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.