网页特效的代码应该加在相应的需要的位置,就是你特效要显示的位置。普通的如显示时间可以放在</head>前面,诸如用<marquee></marquee>滚动特效可以放在你要显示特效的地方(如某个<td></td>之间)。

解决方案 »

  1.   

    最好放在HEAD里,因为先执行的问题!
      

  2.   

    一般来说是放在<head>和</head>中,
      

  3.   

    最好放在最后,</Body>后面,否则容易引起一些小错误。
      

  4.   

    动态导入脚本可以参考我下面的脚本,是我研究的一组实验脚本,虽然是VBS,但是可以很容易移植成为JS。'所属:AriesScript 1.0
    '模块:Mahayana Boot Lib CodeLib
    '说明:加载'[声明部]
    Dim mBtl_CodeLib_SystemScriptVerName  '脚本版本前缀
    Dim mBtl_CodeLib_SystemScriptInfo     '系统加载脚本的信息公共变量。
    Dim mBtl_CodeLib_SystemScriptLanguage '系统默认脚本语言。
    Dim mBtl_CodeLib_SystemScriptInfos()  '系统脚本信息数组ReDim mBtl_CodeLib_SystemScriptInfos(0)'[初始化]
    mBtl_CodeLib_SystemScriptLanguage="VBScript"
    mBtl_CodeLib_SystemScriptVerName="Aries"'[注册部]
    mBtl_CodeLib_SystemScriptInfo_AddItem "Mahayana Boot Lib CodeLib","AriesScript_mBtl_CodeLib.vba"'[加载部]
    mBtl_CodeLib_ScriptLoad "AriesScript_mBot_System.vba",window'[脚本信息服务函数]
    Function mBtl_CodeLib_SystemScriptInfo_AddItem(pScriptName,pScriptFileName)
      '功能:添加脚本信息到mBtl_CodeLib_SystemScriptInfo变量。
      '参数:pScriptName      脚本名
      '      pScriptFileName  脚本文件名  tOutStr=mBtl_CodeLib_SystemScriptInfo
      tOutStr=tOutStr & Chr(13) & Chr(10) & mBtl_CodeLib_SystemScriptVerName & " " & pScriptName & " " & "[" & pScriptFileName & "]"
      
      tArrayEnd=UBound(mBtl_CodeLib_SystemScriptInfos)
      ReDim Preserve mBtl_CodeLib_SystemScriptInfos(tArrayEnd)
      mBtl_CodeLib_SystemScriptInfos(tArrayEnd)=pScriptFileName  mBtl_CodeLib_SystemScriptInfo=tOutStr
    End Function'[脚本导入函数]
    Function mBtl_CodeLib_ScriptLoad(pURL,pWindow)
      '功能:导入指定脚本到指定窗口对象。
      '参数:pURL     指定Script文件的地址。
      '      pWindow  导入该要素的目的窗口对象。
      Set tOutObj=mBtl_CodeLib_ScriptObjCreateByURL(pURL,pWindow)
      pWindow.document.body.insertBefore tOutObj
    End FunctionFunction mBtl_CodeLib_ScriptObjCreateByURL(pURL,pWindow)
      '功能:在指定窗口对象创建一个VBScript的script要素。该要素指定src属性为pURL。
      '参数:pURL     指定Script文件的地址。
      '      pWindow  创建该要素的目的窗口对象。
      Set tOutObj=pWindow.document.createElement("script")
      With tOutObj
        .language=mBtl_CodeLib_SystemScriptLanguage
        .type="text/" & mBtl_CodeLib_SystemScriptLanguage
        .src=pURL
      End With
      Set mBtl_CodeLib_ScriptObjCreateByURL=tOutObj
    End Function'[样式导入函数]
    Function mBtl_CodeLib_StyleLoad(pURL,pWindow)
      '功能:导入指定样式到指定窗口对象。
      '参数:pURL     指定css文件的地址。
      '      pWindow  导入该要素的目的窗口对象。
      Set tOutObj=mBtl_CodeLib_StyleObjCreateByURL(pURL,pWindow)
      pWindow.document.body.insertBefore tOutObj
    End FunctionFunction mBtl_CodeLib_StyleObjCreateByURL(pURL,pWindow)
      '功能:在指定窗口对象创建一个Style的Link要素。该要素指定href属性为pURL。
      '参数:pURL     指定css文件的地址。
      '      pWindow  创建该要素的目的窗口对象。
      Set tOutObj=pWindow.document.createElement("link")  
      With tOutObj
        .rel="StyleSheet"
        .type="text/css"
        .href=pURL
      End With
      Set mBtl_CodeLib_StyleObjCreateByURL=tOutObj
    End Function