#13278 closed bug (notabug)
Convert variable data to jQuery object
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hello, I've noticed that since upgrading to 1.9.0 handling data as jQuery object stopped working for me. To explain what I mean here, here's a short example of ajax call:
$.ajax({ type : 'POST', url : 'someServerScript', data : 'someData', success : function(data) { // return data is a piece of HTML // With previous version, I was able to do this: $(data).addClass('someClass'); // In version 1.9.0 I get error 'unrecognized expression' } });
Please let me know if that description is enough or if I need to collaborate more
Thanks, Oleg
Change History (4)
comment:1 Changed 10 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Here's a jQuery Migrate notice: JQMIGRATE: $(html) HTML strings must start with '<' character
And here's the example return data logged in Firebug console, HTML is correct:
<form action="post" method="post"> <input type="text" size="30" /><br /> <textarea cols="30" rows="5"> </textarea> </form>
comment:3 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | pending → closed |
Well there you go, your string must not start with '<'. Read the upgrade guide or description in the Migrate plugin and it will help.
comment:4 Changed 10 years ago by
Perfect, thanks, couldn't find it there before. $.parseHTML() function helped
Did the jQuery Migrate plugin give you any warnings?