Problem with $(a_string_var) not working in jQuery 1.9.0
Hi all,
Just downloaded jQuery v1.9.0 and ran into this:
var noscript_txt = $element.find('noscript').text()';
var $new_img_elm = $(noscript_txt);
...which found my image text inside a <noscript> tag just fine in previous versions of jQuery and created a jQuery image object. Now, for some reason it errors with:
Syntax error, unrecognized expression: <img src="http://site.com/link/to/img/sized/sunset.jpg" alt="A beautiful sunset!" />
So it obviously found the text, but couldn't use it like before to create a jQuery image object. So I'm not sure if this is a bug, or just a more refined version of jQuery rejecting what might have been a sketchy way to do it before.
The work around I came up with is this:
$full_size = $('<div>' + noscript_txt + '</div>').find('img');
...which works fine. But I wonder if there might be a better way or why it worked before and not now.
Just curious.