将ajax回调替换为jquery回调 [英] Replace ajax callback with a jquery callback

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

问题描述

有人可以帮助我将以下ajax回调方法替换为jquery回调方法吗?

Can someone help me replace the following ajax callback method with a jquery callback method ?

function PostCall() {

        $('#txtRes').val('Please Wait......');
        var reqval = $('#txtReq').val();
        $.ajax({
            url: "myPage",
            type: 'post',
            data: "{'name':'" + reqval + "'}",
            async: true,
            contentType: "application/json",
            success: function (result) {
                $('#txtRes').val(result);

            }

        });
    }

推荐答案

(' #txtRes ').val(' 请稍候...'); var reqval =
('#txtRes').val('Please Wait......'); var reqval =


('
('#txtReq').val();


.ajax({ url:" , 类型:' post', 数据:" + reqval + " , 异步: true , contentType:" , 成功:功能(结果){
.ajax({ url: "myPage", type: 'post', data: "{'name':'" + reqval + "'}", async: true, contentType: "application/json", success: function (result) {


这篇关于将ajax回调替换为jquery回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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