2013-03-25 58 views
0

不知道这是否是一个新问题,但到目前为止我还没有找到任何解决方案。我在我的系统中有以下功能 - 一个jQuery的移动MVC网络应用程序 - 它在除IE以外的所有浏览器(在我的情况下为9)都很好用。它始终是我第一次使用它,但第二次它总是失败,我不知道为什么。jquery ajax调用IE中只触发一次9

非常感谢您的帮助!

function getAndShowPflichten(immoid, days) { 

      var seite = 1; 

      if (sessionStorage.getItem("seite") != null) { 
       seite = sessionStorage.getItem("seite"); 
      } 

      if (immoid == "") { 
       alert("No ID found!"); 
       return; 
      } else { 
       $.post("getPflichtenFuerImmobilieJson", { id: immoid, frist: days, seite: seite }, showInspections, 'json').fail(
       function() { alert("Überprüfen Sie bitte Ihre Datenverbindung."); $.mobile.loading('hide'); }); 
      } 
     } 

在MVC控制器的方法是:

public ActionResult getPflichtenFuerImmobilieJson(int id, int frist, int seite) 
     { 
      if (loggedIn()) 
      { 
       int benutzerLoggedIn = Convert.ToInt32(Session["benutzerId"]); 
       var model = immoVerwalter.getPflichtenFuerImmobilieJson(benutzerLoggedIn, id, frist, seite); 

       return Json(model, JsonRequestBehavior.AllowGet); 
      } 
      else 
      { 
       return Json("abgemeldet", JsonRequestBehavior.AllowGet); 
      } 
     } 
+0

对不起忘了说我使用jQuery 1.7.1和jQuery移动浏览器控制台 – smatyas 2013-03-25 11:44:10

+0

任何错误可惜不是,但如果我切换到C ompatibility查看然后它每次工作... – 2013-03-25 12:09:07

+0

1.2.0 – smatyas 2013-03-25 12:24:30

回答

0

对不起它无关的Ajax或其他东西,似乎是为变量天(见下文)的方法,不叫 - 天为null,被称为第二次...

var days = $("#interval").val();