Jquery .html replacer just empties my selector, what's wrong!?

Posted by jphenow on Stack Overflow See other posts from Stack Overflow or by jphenow
Published on 2010-06-14T20:35:35Z Indexed on 2010/06/14 20:42 UTC
Read the original article Hit count: 147

Filed under:
|
|
$("#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

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery