在脚本标签中是否有必要使用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) 出于某种原因,我收到此错误消息:
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
有任何想法吗?