相关疑难解决方法(0)

脚本标记中何时需要CDATA部分?

在脚本标签中是否有必要使用CDATA标签,如果是这样的话?

换句话说,何时何地:

<script type="text/javascript">
//<![CDATA[
...code...
//]]>
</script>
Run Code Online (Sandbox Code Playgroud)

比这更好:

<script type="text/javascript">
...code...
</script>
Run Code Online (Sandbox Code Playgroud)

html javascript xhtml cdata

887
推荐指数
13
解决办法
34万
查看次数

错误:未捕获的SyntaxError:意外的令牌<

出于某种原因,我收到此错误消息:

Uncaught SyntaxError: Unexpected token <
Run Code Online (Sandbox Code Playgroud)

对于这行代码:

title: '<img src="/images/text/text_mario_planet_jukebox.png" id="text_mario_planet_jukebox"/>',
Run Code Online (Sandbox Code Playgroud)

在这方面:

$(document).ready(function() {
    $('#infobutton').click(function() {
        $('#music_descrip').dialog('open');
    });
        $('#music_descrip').dialog({
            title: '<img src="/images/text/text_mario_planet_jukebox.png" id="text_mario_planet_jukebox"/>',
            autoOpen: false,
            height: 375,
            width: 500,
            modal: true,
            resizable: false,
            buttons: {
                'Without Music': function() {
                    $(this).dialog('close');
                    $.cookie('autoPlay', 'no', { expires: 365 * 10 });
                },
                'With Music': function() {
                    $(this).dialog('close');
                    $.cookie('autoPlay', 'yes', { expires: 365 * 10 });
                }
            }
        });
    });
Run Code Online (Sandbox Code Playgroud)

我认为一切都应该很好,但我不明白为什么<会以某种方式抛弃它.

哎呀,忘了展示这是怎么回事!我的错,

http://www.marioplanet.com/index.asp

有任何想法吗?

jquery token

45
推荐指数
4
解决办法
22万
查看次数

标签 统计

cdata ×1

html ×1

javascript ×1

jquery ×1

token ×1

xhtml ×1