Skip to main content

Bug Tracker

Side navigation

#13278 closed bug (notabug)

Opened January 20, 2013 10:50PM UTC

Closed January 20, 2013 11:16PM UTC

Last modified January 21, 2013 07:42AM UTC

Convert variable data to jQuery object

Reported by: oyapparov@seznam.cz Owned by: oyapparov@seznam.cz
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

Attachments (0)
Change History (4)

Changed January 20, 2013 10:51PM UTC by dmethvin comment:1

owner: → oyapparov@seznam.cz
status: newpending

Did the jQuery Migrate plugin give you any warnings?

Changed January 20, 2013 11:00PM UTC by Oleg Yapparov <oyapparov@seznam.cz> comment:2

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>

Changed January 20, 2013 11:16PM UTC by dmethvin comment:3

resolution: → notabug
status: pendingclosed

Well there you go, your string must not start with '<'. Read the upgrade guide or description in the Migrate plugin and it will help.

Changed January 21, 2013 07:42AM UTC by anonymous comment:4

Perfect, thanks, couldn't find it there before. $.parseHTML() function helped