Jquery .html replacer just empties my selector, what's wrong!?
- by jphenow
$("#autoNames").html(function (index, html) {
var begin = "<script language='javascript' type='text/javascript'> var names = [";
var end = String('];' + '<' + '/' + 'script' + '>');
var result = begin.concat(jsonService, end);
$("#autoNames").html(result);
return false;
});
I can't figure out for the life of me why this doesn't work. I've gotten the html function to work before, but for some reason this just leaves my autoNames tag empty... and i've called an alert() on the result variable and things exist in that string... any clues?
Thanks