Side navigation
#14590 closed bug (invalid)
Opened November 29, 2013 07:31AM UTC
Closed December 17, 2013 08:39AM UTC
Last modified January 03, 2014 05:02AM UTC
Issue in .html()
Reported by: | ravindra.alld@gmail.com | Owned by: | ravindra.alld@gmail.com |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
When I use .html (String) method where string has some java script. After apply .html its fails and give error as
Uncaught SyntaxError: Unexpected token < jquery-1.10.2.js:612 <https://localhost:7004/XYZ/JS/jquery-1.10.2.js>(anonymous function)jquery-1.10.2.js:612
The same piece of code is working fine in jQuery 1.9.1.
I debug the issue and got a point that the text which is appended by the .html method has some java script inside it and also has the < sign in a for loop.
Please suggest the appropriate way of solving this issue.
Attachments (0)
Change History (4)
Changed December 02, 2013 03:49PM UTC by comment:1
Changed December 02, 2013 03:50PM UTC by comment:2
owner: | → ravindra.alld@gmail.com |
---|---|
status: | new → 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—you may need to change this to a specific version depending on the test case.
To get you started, use the appropriate boilerplate:
- jQuery 1.x http://jsfiddle.net/FrKyN/
- jQuery 2.x http://jsfiddle.net/VUp3e/
Open the link and click to "Fork" (in the top menu) to begin.
Also, please read:
- http://blog.jquery.com/2013/03/01/jquery-2-0-beta-2-released/
- http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released/
Additional resources:
- Won't Fix: http://contribute.jquery.org/wont-fix/
- CLA: http://contribute.jquery.org/CLA/
- Style Guide: http://contribute.jquery.org/style-guide/js/
Changed December 17, 2013 08:39AM UTC by comment:3
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!
Changed January 03, 2014 05:02AM UTC by comment:4
Hi,
Sorry for the late reply.
I got solution of my issue. The problem is in the string which we are going to set by .html() method.
In that screen there is a script tag which is pointing to some external JS file and that file is not exist at that location. It is causing the error as
Uncaught SyntaxError: Unexpected token < jquery-1.10.2.js:612
By removing that script tag issue is resolved.
Might be this is an enhancement in jQuery 1.10.2 because same piece of code is working fine in jQuery 1.9.2.
Anyways thanks for the response :)
#14591 is a duplicate of this ticket.