Bug Tracker

Ticket #10955 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

Brower crashing or either hanging when we are using Jquery Clone method.This happens in all browser

Reported by: kiran@… Owned by: kiran@…
Priority: low Milestone: None
Component: manipulation Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

Hi,

All my browser are either hanging or crashing due to below code,Any ideas as what is happening.While debugging my jsp page, I narrowed down to below clone method of jquery and was able to reproduce it with below simple test case.Also as per my understanding there are some tags in HTML5 which do not require to have end tags, does UL require end tag as per HTML5 ?.

<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Simple Test Case</title> </head>

<body> <ul> <li>Test1</li> <li>Test2</li> <li>Test3</li> <li>Test4</li> <li>Test5</li> <li>Test6</li> </ul>

<script type="text/javascript" src="js/jquery-1.6.4.js"></script> <script> jQuery('ul').clone().appendTo('body'); </script> </body> </html> I find this hang or crash issues with singleton HTML 5 Tags.Appreciate in case if you take a look and suggest.

Change History

comment:1 follow-up: ↓ 2 Changed 3 years ago by sindresorhus

  • Owner set to kiran@…
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 in reply to: ↑ 1 Changed 3 years ago by kiran@…

  • Status changed from pending to new

I dont see the browser crash in jsFiddle when I followed your instructions.

Here is the link  http://jsfiddle.net/kiranbadi1991/eEqED/

Sounds strange that the browser did not hang on jsfiddle and it kills when I load the same code via my browser with jsfiddle.

Replying to sindresorhus:

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:3 Changed 3 years ago by kiran@…

Sorry there is some typo error

Please read this as "Sounds strange that the browser did not hang on jsfiddle and it kills when I load the same code via my browser with jsfiddle."

as

"Sounds strange that the browser did not hang on jsfiddle and it kills when I load the same code via my browser without jsfiddle"

comment:4 follow-up: ↓ 5 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed
  • Component changed from unfiled to manipulation

That is generally an indication that issue lies in your code and not in jQuery, this works fine for me

comment:5 in reply to: ↑ 4 Changed 3 years ago by kiran@…

Hi, you mean to say that you have tried below code and its working fine in your browser without crash or hang.It does not work any of my browsers without hang or crash. What version of jquery did you use ? I am using jquery 1.6.4.

<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>Simple Test Case</title>

<script type="text/javascript" src="js/jquery-1.6.4.js"></script>

</head>

<body> <ul> <li>Test1</li> <li>Test2</li> <li>Test3</li> <li>Test4</li> <li>Test5</li> <li>Test6</li>

<script>

jQuery('ul').clone().appendTo('body'); </script>

</body> </html>

Replying to rwaldron:

That is generally an indication that issue lies in your code and not in jQuery, this works fine for me

comment:6 Changed 3 years ago by sindresorhus

Just to explain, you get the crash since you're not closing your <ul> tag, and the browser is then awesome and thinks your script tag i a part of the ul, and the script then tries to clone the <ul> with the <li>s and the <script> tag itself.

Note: See TracTickets for help on using tickets.