代码部分
<script src="/c/Currency.js" type="text/javascript" ></script> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" > </asp:ScriptManager> <div id="Content"> <div class="nobg"> <div id="Top"> <div class="left"> <a href="index.html"><img src="/i/xyz.gif" alt="Dexia" /></a> </div> <div class="right"> <div id="tmenu"> <ul> <li class="aboutus"><a href="/aboutus/"><img src="/i/menu/about_us.gif" alt="About Us"></a></li> <li class="presscenter"><a href="/press_center/"><img src="/i/menu/press_center.gif" alt="Press Center"></a></li> <li class="financials"><a href="/financials/"><img src="/i/menu/financials.gif" alt="Financials"></a></li> <li class="xysza"><a href="/work_xyz/"><img src="/i/menu/xyz.gif" alt="Work&xyz"></a></li> <li class="sitemap"><a href="/site_map/"><img src="/i/menu/site_map.gif" alt="Site Map"></a></li> <li class="ruski"><a href="/russian/"><img src="/i/menu/try.gif" alt="rt"></a></li> <li class="search"><a href="/search/"><img src="/i/menu/search.gif" alt="Search"></a></li> <li class="mainpage"><a href="/index.html"><img src="/i/menu/main_page.gif" alt="Main Page"></a></li> </ul> </div> <div id="tm"></div> </div> <div id="tms"></div> <script type="text/javascript"> var activepage = 0 </script> <script src="/c/inc/menu.js" type="text/javascript"></script> <span id="txt_submenu"></span> <script src="/c/inc/submenu.js" type="text/javascript"></script> </div> <div id="Middle">
不幸的是,在我将html文件转换为aspx后,这个菜单没有出现,我错过了什么?
我是否遗漏了要启用的内容?由于index.html文件的顺序与index.aspx完全相同,所以我只想查看js的菜单.请帮忙!
我刚刚发布,当我从文件中删除时,会出现菜单.您可以查看下面的Currency.js的内容..请检查它,让我知道如何解决这个问题
PS:我试图将Currency.js的引用位置替换为header块.但它也没有用..
Currency.js
function CallMe() { // call server side method PageMethods.GetData(function (result) { DcSet("lblUsdRub",result.UsdRub); DcSet("lblEurRub",result.EurRub); DcSet("lblMicex",result.Micex); DcSet("lblUrals",result.Urals); DcSet("lblUsdEur",result.UsdEur); DcSet("lblUsdTur",result.UsdTur); DcSet("lblNasdaq",result.Nasdaq); DcSet("lblImkb100",result.Imkb100); }); } function DcSet(labelName,value) { document.getElementById(labelName).innerText = value.toFixed(3); } (function () { var status = true; var fetchService = function () { if (status) { CallMe(); status = false; } setTimeout(fetchService,300000);//Every Five Minutes,Update Data status = true; } window.onload = fetchService; } ());
main.js
我实际得到了答案.我覆盖了onload方法.现在,我需要在下面方法的加载时间运行Currency的必要fetchService.我怎样才能调用window.onload = fetchService;或者他在main.js下面的所有函数()请帮忙吗?
window.onload = function () { preload(); init(); externalLinks(); topmenu.Build(); if (typeof sIFR == "function") { sIFR.replaceElement(named({ sSelector: "h1",sFlashSrc: "/swf/Futura_Bk_BT.swf",sWmode: "transparent",sColor: "#027DA2",sLinkColor: "#FFFFFF",sHoverColor: "#FFFFFF",sFlashVars: "" })); } initHDS(); SubMenuKaydir(); StartCurrencyOnLoad(); }