我无法调用ajax方法 [英] I am not able to call the ajax method

查看:91
本文介绍了我无法调用ajax方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调试它时,我无法调用ajax方法从$ .ajax跳过({line。我在这里做错了。这是我的代码

I am not able to call the ajax method when i debug it is jumping from $.ajax({ line. Am i doing any mistake here.Here is my code

$.ajax({
        data: '{UserCode:"' + $('#txtUserName').val() + '",Password:'
                + $('#txtUserName').val() + '"}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: onSuccess,
        fail: onFail
    });
}

function buttonClick() {
        CallPageMethod("GetLoginDetails", success, fail);
    }

    function success(response) {
        if (response.d) {
           alert('');
        }

    }

    function fail(response) {
        //alert("An error occurred.");
    }




<asp:Button ID="btnLogIn" runat="server" Text="Sign In" OnClientClick="return buttonClick();" />

推荐答案

.ajax({line。我在这里做错了。这是我的代码

.ajax({ line. Am i doing any mistake here.Here is my code


.ajax({
data:' {UserCode:' +
.ajax({ data: '{UserCode:"' +


' #txtUserName')。val()+ ' ,密码:'
+
('#txtUserName').val() + '",Password:' +


这篇关于我无法调用ajax方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆