成功函数未在状态码上执行:200在OK类型的jquery ajax中确定 [英] success function not executing on Status Code:200 OK in jquery ajax in post type

查看:89
本文介绍了成功函数未在状态码上执行:200在OK类型的jquery ajax中确定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法读取jquery ajax对jquery函数成功完全执行的响应以及状态200 ok错误函数正在运行。

请帮助,参考下面的代码





I'm not able to read response of jquery ajax on success full execution of jquery function and on status 200 ok error function is running.
Please help, for reference see below code


<script>
       $(document).ready(function () {
           $('#loadingPanel').hide();
           $('#btnsave').click(function () {

               var Name = $('#txtName').val();
               var Head = $('#txtHead').val();
               var Phone = $('#txtPhone').val();
               var Address = $('#txtAdd').val();
               alert(Name + Phone + Head + Address);
               //alert(data);
               //$('#loadingPanel').show();
               $.ajax({
                   url: "WebService1.asmx/success",
                   type: "POST",
                   dataType: "jsonp",
                   contentType: "application/json; character=utf-8",
                   data: '{"Name": "' + Name + '","Head": "' + Head + '","Phone": "' + Phone + '","Address": "' + Address + '"}',

                   //data: JSON.stringify(Details),
                   success: function (data, status) {
                       alert(data.responseData.results.length + ' results found!');
                   },
                   error: function () {
                       alert('Something goes wrong!');
                   }

               });

           });

       });
   </script>







Remote Address:[::1]:11679
Request URL:http://localhost:11679/WebService1.asmx/success?callback=jQuery11020997845095815137_1433094227735
Request Method:POST
Status Code:200 OK









责任是





Respons is

{"d":"25"}

推荐答案

(document).ready(function(){
(document).ready(function () {


('#loadPanel')。hide();
('#loadingPanel').hide();


('#btnsave')。click(function(){

var Name =
('#btnsave').click(function () { var Name =


这篇关于成功函数未在状态码上执行:200在OK类型的jquery ajax中确定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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