2011-02-03 44 views
0

場景:使用MVC3將Razor的部分視圖加載到jquery選項卡(Ajax模式)中& Razor。在FF中正常工作,但在IE8或IE7中無法正常工作。Jquery製表符不能在IE中加載部分視圖8

問題:我可以跟蹤AJAX請求在螢火細&響應和看的局部視圖從所述服務器(含有的jqGrid HTML輔助方法)返回在IE無關。這種負載高達精細在firefox.But的標籤conatiners內發生和我無法看到任何ajax請求被改變的標籤發射時,當我使用Fiddler.Ive嘗試玩ajaxOptions當我初始化jq標籤無濟於事。我在MVC2上遇到了這個問題,並且我使用了靜態的標籤內容,我不想這次,因爲我需要延遲加載。 Anyhelp將不勝感激,因爲我已經耗盡了每條大道,謝謝。 :)下面是來自IE8的整頁源代碼轉儲,使用剃鬚刀視圖引擎重組。

(鏈接到所有CSSS和JS庫)

<script type="text/javascript"> 
    $(document).ready(function() {  
     $("#tabs").tabs(); 

    }); 
</script> 
    </head> 
    <body> 
    <h2>Index</h2> 
    <div id="tabs"> 
     <ul> 
     <li><a href="/"><span>Home</span></a> </li> 
      <li><a href="/ServicesMonitored/GetServicesMonitoredTab"><span>Monitored Services</span></a> </li> 
      <li><a href="/ServicesMonitored/GetServicesFullTab"><span>Full Services</span></a></li> 

     </ul> 
    </div> 
</body> 
</html> 

從控制器:

公共類ServicesMonitoredController:控制器 {

IServicesMonitoredRepository<ServiceHeaderInfo,InfoDataItem> Services; 
    public ServicesMonitoredController() { 

     Services = new ServicesMonitoredRepository(); 
    } 

    public ActionResult GetServicesMonitoredTab() 
    { 
     return PartialView("ServicesMonitoredTab"); 
    } 
    public ActionResult GetServicesFullTab() 
    { 
     return PartialView("ServicesFullTab"); 
    } 

    #region Return Services 
    [HttpPost] 
    public JsonResult ReturnServices(string sidx, string sord, int page, int rows) 
    { blahblahblah For JqGrid residing in tabs 
    } 

}

回答

0

嘗試把你的代碼在一個準備好的功能。在設置函數引用#tab元素時,DOM很可能沒有完全加載或準備好被操作。

$().ready(function() { 
    $(function() {   
     $("#tabs").tabs(); 
    }); 
}); 
+0

嘿那裏對不起生病編輯代碼,因爲它是在jquery Dom ready事件處理程序,請原諒打字錯誤 – P0DD3R5 2011-02-03 14:50:54