2016-02-27 98 views
1

作品我无法找到问题 请帮我 我jQuery代码在IE和Chrome,但它不会在Firefox 工作,我的代码片段是:JQuery的代码在Chrome和IE,但它不能在Firefox

var dto = { 'searchObj': LogInObj }; 
$.ajax(
    { 
     url: "Default.aspx/GetLogIn", 
     //url: "Services.asmx/HelloWorld", 
     data: JSON.stringify(dto), 
     //data:'{}', 
     type: "POST", 
     contentType: "application/json; charset=utf-8", 
     datatype: "Json", 
     success: function (result) { 
      var rt = result.d; 
      if (rt.Success) { 
       var data = rt.Data; 
       $.session.set('UserId', data[0].UserId); 
       var userType = data[0].UserTypeId; 
       if (userType == 1) { 
        LogInPage.GetClientInfo(data[0].UserId); 
        **LogInPage.SaveUserLogs();** 
        window.location = 'AdminManager.aspx'; 
       } 
       else if (userType == 2) { 
        LogInPage.GetClientInfo(data[0].UserId); 
        LogInPage.SaveUserLogs(); 
        window.location = 'Base.aspx'; 
        } 
       else 
        alert(' 

我需要调用LogInPage.SaveUserLogs()方法。 感谢您的回复

+2

在控制台中是否出现错误?提到代码应该做什么以及在Firefox中运行时会发生什么......(顺便说一下,您知道Javascript区分大小写,对吗?''datatype:“Json”'应该是'dataType:“json”'。) – nnnnnn

+2

好友,首先你的问题太短,无论你问什么。您需要知道哪个部分不能正常工作,您如何调用它以及您正在使用哪些数据。请在这里添加一个jsfiddle或代码片段,以便我们可以提供帮助。也简化你的代码。所有的代码不可能无法工作。只有一部分可能无法正常工作,您需要向我们指出该部分 –

+0

感谢您的回复 –

回答

0

我使用键盘事件的文本输入,它不能在Firefox中工作 所以我改变它按键和我的问题得到解决。 如有需要,我可以提供更多详情。

相关问题