Javascript 无法记录。请在此代码上写入
我需要修复哪些代码?谢谢!Javascript 无法记录。请在此代码上写入,javascript,Javascript,我需要修复哪些代码?谢谢! document.write(' var parameters = { id: "1" , src: "<?php echo $source?>" , autoPlay: "false" , width: "638" , height: "400"
document.write('
var parameters =
{ id: "1"
, src: "<?php echo $source?>"
, autoPlay: "false"
, width: "638"
, height: "400"
, autoHideControlBar: "false"
, controlBarPosition: "bottom"
};
swfobject.embedSWF
( "vcp.swf"
, "player"
, parameters["width"], parameters["height"]
, "10"
, {}
, parameters
, { allowFullScreen: "true" }
, { name: "sMPlayback" }
);
');
document.write('
var参数=
{id:“1”
,src:“
,自动播放:“错误”
,宽度:“638”
,身高:“400”
,AutoHideControl栏:“false”
,控件栏位置:“底部”
};
swfobject.embeddeswf
(“vcp.swf”
“玩家”
,参数[“宽度”],参数[“高度”]
, "10"
, {}
,参数
,{allowFullScreen:“true”}
,{name:“sMPlayback”}
);
');
您不能像传递给document.write()
的字符串那样在字符串中有新行……但是由于您在页面中,只需删除文档。write
,因此您的结果应该是:
<script type="text/javascript">
var parameters =
{ id: "1"
, src: "<?php echo $source?>"
, autoPlay: "false"
, width: "638"
, height: "400"
, autoHideControlBar: "false"
, controlBarPosition: "bottom"
};
swfobject.embedSWF
( "vcp.swf"
, "player"
, parameters["width"], parameters["height"]
, "10"
, {}
, parameters
, { allowFullScreen: "true" }
, { name: "sMPlayback" }
);
</script>
var参数=
{id:“1”
,src:“
,自动播放:“错误”
,宽度:“638”
,身高:“400”
,AutoHideControl栏:“false”
,控件栏位置:“底部”
};
swfobject.embeddeswf
(“vcp.swf”
“玩家”
,参数[“宽度”],参数[“高度”]
, "10"
, {}
,参数
,{allowFullScreen:“true”}
,{name:“sMPlayback”}
);
您不能像传递给document.write()
的字符串那样在字符串中有新行……但是由于您在页面中,只需删除文档。write
,因此您的结果应该是:
<script type="text/javascript">
var parameters =
{ id: "1"
, src: "<?php echo $source?>"
, autoPlay: "false"
, width: "638"
, height: "400"
, autoHideControlBar: "false"
, controlBarPosition: "bottom"
};
swfobject.embedSWF
( "vcp.swf"
, "player"
, parameters["width"], parameters["height"]
, "10"
, {}
, parameters
, { allowFullScreen: "true" }
, { name: "sMPlayback" }
);
</script>
var参数=
{id:“1”
,src:“
,自动播放:“错误”
,宽度:“638”
,身高:“400”
,AutoHideControl栏:“false”
,控件栏位置:“底部”
};
swfobject.embeddeswf
(“vcp.swf”
“玩家”
,参数[“宽度”],参数[“高度”]
, "10"
, {}
,参数
,{allowFullScreen:“true”}
,{name:“sMPlayback”}
);
欢迎来到SO。你有什么问题?什么不起作用?请添加更多细节并描述您正在做什么。这是在外部文件中还是在页面中,如果它在页面中,为什么还要使用文档。编写?在与HTML相同的页面中,我发现由于双引号或分号错误,此Javascript代码未执行?欢迎使用。你有什么问题?什么不起作用?请添加更多细节并描述您正在做的事情。这是在外部文件中还是在页面中,如果在页面中,为什么还要使用文档。编写?在与HTML相同的页面中,我发现由于双引号或分号错误,此Javascript代码未执行?