2

could not find a solution to my problem so i'll ask here.

When i insert jQuery file, i get an error on line 2: unexpected token ILLEGAL

Code:

jQuery(document).ready(function(){
    $('body').append('
        <div id="style_selector">
        <div id="style_selector_container">
        // another chunk of code
        </div><!-- #style_selector end -->');
});

Thank you in advance

4

1 回答 1

6
jQuery(document).ready(function(){
    $('body').append('<div id="style_selector"><div id="style_selector_container"></div>');
});

这将完成这项工作。因为当您使用 jquery 附加内容时,它不能包含新行。

于 2013-05-05T14:31:45.730 回答