花千骨之长留义父衍道:我不懂JS,谁来教我写函数?

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 02:15:22
为了方便插入 flash 我写了个函数。但是没有JS基础,写不对。希望大哥大姐们帮我纠正一下。也许基本语法都没写对吧。哎~

flash.js
=========================
//插入flash的函数
var url,width,Height
function LoadFlash(url,width,Height) {

document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='+ width +' height='+Height+'>");
document.write(" <param name='movie' value='+url+' />");
document.write(" <param name='quality' value='high' />");
document.write(" <embed src='+url+' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='+width+' height='+Height+'></embed>");
document.write("</object>");}

flash.htm
============================
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<SCRIPT type="text/javascript" src="flash.js"></SCRIPT>
</head>

<body>
<SCRIPT type="text/javascript">LoadFlash('myly.swf','1003','104');</SCRIPT>
</body>
</html>

没有什么问题呀