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()方法。 感谢您的回复
在控制台中是否出现错误?提到代码应该做什么以及在Firefox中运行时会发生什么......(顺便说一下,您知道Javascript区分大小写,对吗?''datatype:“Json”'应该是'dataType:“json”'。) – nnnnnn
好友,首先你的问题太短,无论你问什么。您需要知道哪个部分不能正常工作,您如何调用它以及您正在使用哪些数据。请在这里添加一个jsfiddle或代码片段,以便我们可以提供帮助。也简化你的代码。所有的代码不可能无法工作。只有一部分可能无法正常工作,您需要向我们指出该部分 –
感谢您的回复 –