html<body onload=“内容”>怎么才能写到JS里面来调用或者有什么办法把他弄的短一些
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>拼图游戏</title>
<link href="danghaizheng.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="danghaizheng.js"></script>
<script type="text/javascript" src="dhzjs.js"></script>
<style type="text/css">
</style>
</head>
把下面body这里的写到一个JS或什么的把他在本页里哩写短一些
<body onload="MM_dragLayer('Layer2','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'');MM_dragLayer('Layer3','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'');MM_dragLayer('Layer4','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'')" onunload="MM_popupMsg('欢迎来到我的网站!')">
<div id="Layer1"><img src="images/1.jpg" width="714" height="108" /></div>
<div id="Layer2"><img src="images/1_01.gif" width="66" height="120" /></div>
<div id="Layer3"><img src="images/1_02.gif" width="439" height="120" /></div>
<div id="Layer4"><img src="images/1_03.gif" width="495" height="120" /></div>
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>拼图游戏</title>
<link href="danghaizheng.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="danghaizheng.js"></script>
<script type="text/javascript" src="dhzjs.js"></script>
<style type="text/css">
</style>
</head>
把下面body这里的写到一个JS或什么的把他在本页里哩写短一些
<body onload="MM_dragLayer('Layer2','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'');MM_dragLayer('Layer3','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'');MM_dragLayer('Layer4','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'')" onunload="MM_popupMsg('欢迎来到我的网站!')">
<div id="Layer1"><img src="images/1.jpg" width="714" height="108" /></div>
<div id="Layer2"><img src="images/1_01.gif" width="66" height="120" /></div>
<div id="Layer3"><img src="images/1_02.gif" width="439" height="120" /></div>
<div id="Layer4"><img src="images/1_03.gif" width="495" height="120" /></div>
</body>
</html> 展开
2014-11-17 · 知道合伙人软件行家
yfcp
知道合伙人软件行家
向TA提问 私信TA
知道合伙人软件行家
采纳数:1748
获赞数:5545
有多年网站建设相关工作经验。熟悉ASP、ASP.net、VB、JavaScript、HTML等语言和CSS、Ajax等相关技术。
向TA提问 私信TA
关注
展开全部
js中写:
function abc(){
MM_dragLayer('Layer2','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'');MM_dragLayer('Layer3','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'');MM_dragLayer('Layer4','',0,0,0,0,true,false,-1,-1,-1,-1,false,false,3,'',false,'')
}
<body onload="abc()" onunload="MM_popupMsg('欢迎来到我的网站!')">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询