Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(script): Incorrectly reading script text on ie (follow-up) #890

Closed
wants to merge 1 commit into from

Conversation

tleruitte
Copy link
Contributor

The solution proposed by Misko (#0ec13428d7ba1cff67cde43bc90277481cab82ba) break the code for Chrome. The JQuery docs says: "To get the value of a script element, use the .html() method." (http://api.jquery.com/text/)

@mhevery
Copy link
Contributor

mhevery commented Apr 18, 2012

I did more testing and IE with .html() always prepends '\n' to the result, where as .text does not

The solution proposed by Misko (#0ec13428d7ba1cff67cde43bc90277481cab82ba) break the code for Chrome. The JQuery docs says: "To get the value of a script element, use the .html() method." (http://api.jquery.com/text/)
@tleruitte
Copy link
Contributor Author

I didn't succeed to reproduce the bug with Chrome so it should have come from elsewhere, my bad. I've removed the tagName check as requested.

I've also observed that IE prepends the '\n'. Since the content of the script text should be html I don't know if that really matters though.

@mhevery
Copy link
Contributor

mhevery commented Apr 20, 2012

I think the \n is a problem, so I think I am going to leave it this way.

@tleruitte
Copy link
Contributor Author

Fair enough.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants