Skip to content Skip to sidebar Skip to footer

Making A Variable In Jquery 1.9.1 Fails And In 1.8.3 Doesn't

I just upgraded to 1.9.1 After some technical defiificulties all work except: var $newthumbs = $('

Solution 1:

If you remove the spaces, it will work:

var$newthumbs= $('<div id=\"car-7\" class=\"thumbnail_car thumbnail span2\" data-sorting-top=\"2\" data-sorting-date=\"2013-01-12 16:47:31 UTC\"></div>');

DEMO: http://jsfiddle.net/dirtyd77/KFmMQ/1/

Solution 2:

Your problem are the whitespaces in the beginning of the string. I have no idea why this is a problem, but it obviously is.

By the way: You can remove the pointless backslashes:

var$newthumbs= $('<div id="car-7"class="thumbnail_car thumbnail span2" data-sorting-top="2" data-sorting-date="2013-01-12 16:47:31 UTC"></div>');

or you can use double quotation marks for the surrounding string:

var$newthumbs= $("<div id=\"car-7\" class=\"thumbnail_car thumbnail span2\" data-sorting-top=\"2\" data-sorting-date=\"2013-01-12 16:47:31 UTC\"></div>");

Post a Comment for "Making A Variable In Jquery 1.9.1 Fails And In 1.8.3 Doesn't"