html js代码问题
<scripttype="text/javascript">functionopenShutManager(oSourceObj,oTargetObj,shutAble,...
<script type="text/javascript">
function openShutManager(oSourceObj,oTargetObj,shutAble,oOpenTip,oShutTip){
var sourceObj = typeof oSourceObj == "string" ? document.getElementById(oSourceObj) : oSourceObj;
var targetObj = typeof oTargetObj == "string" ? document.getElementById(oTargetObj) : oTargetObj;
var openTip = oOpenTip || "";
var shutTip = oShutTip || "";
if(targetObj.style.display!="none"){
if(shutAble) return;
targetObj.style.display="none";
if(openTip && shutTip){
sourceObj.innerHTML = shutTip;
}
} else {
targetObj.style.display="block";
if(openTip && shutTip){
sourceObj.innerHTML = openTip;
}
}
}
</script>
这一段 <script type="text/javascript"> </script> 这里面的代码我直接做成.js的文件 在本地调用可以吗?或者和多个js文件合并一起? 求大神指点迷津
用这段代码调用
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/lizi.js"></script> 展开
function openShutManager(oSourceObj,oTargetObj,shutAble,oOpenTip,oShutTip){
var sourceObj = typeof oSourceObj == "string" ? document.getElementById(oSourceObj) : oSourceObj;
var targetObj = typeof oTargetObj == "string" ? document.getElementById(oTargetObj) : oTargetObj;
var openTip = oOpenTip || "";
var shutTip = oShutTip || "";
if(targetObj.style.display!="none"){
if(shutAble) return;
targetObj.style.display="none";
if(openTip && shutTip){
sourceObj.innerHTML = shutTip;
}
} else {
targetObj.style.display="block";
if(openTip && shutTip){
sourceObj.innerHTML = openTip;
}
}
}
</script>
这一段 <script type="text/javascript"> </script> 这里面的代码我直接做成.js的文件 在本地调用可以吗?或者和多个js文件合并一起? 求大神指点迷津
用这段代码调用
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/lizi.js"></script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询