ajax回调函数 返回404
来源:互联网 发布:交换机更换网络 编辑:程序博客网 时间:2024/04/30 04:04
先贴代码:
JS代码如下。
PProductComposing.searchUp = function() {var _id = "#pProductComposing_type";var url = $('#ctx').val()+"/pages/pProductComposing/form/onChange?productId=" + $("#productId").val()+"&type=" + $("#pProductComposing_type").val();$.ajax( {type : "POST",async : false,"dataType" : 'json', "url": url, "success": function(response) { alert(111); if (response.isSuccess == "true") { alert(response.id); } else { openErrorAlertModalInFrame(response.msg); } }, "error": function(response) { alert(JSON.stringify(response)); alert("请正确选择类型。"); PProductComposing.disableAllButton(); } } );};
通过ajax请求到controller中执行方法,方法执行完成后,直接跳到error 的回调函数中。
controller中的方法并没有其他问题。
百度ajax如何判断是success 还是 error ,是通过返回值,是否是JSON类型来判断的。
解决办法,在后台controller方法上加注解。
@responsebody
0 0
- ajax回调函数 返回404
- ajax回调函数,返回的字符串乱码解决
- ajax回调函数
- Ajax 回调函数
- JQuery ajax回调函数
- jquery Ajax回调函数
- AJAX和回调函数
- AJAX使用回调函数
- ajax作用域 回调函数的返回值 异步传输时得不到值
- ajax执行成功返回error回调函数与jquery.sirialize()乱码问题
- ajax请求,返回的数据不看不到,回调函数没有执行
- jquery ajax请求成功,返回了数据,但是不进success回调函数的问题
- 关于ajax请求返回json数据不进入回调函数的可能情况
- js遍历ajax回调函数返回值中的object对象
- WndProc()回调函数的返回值
- $.get回调函数的返回值
- 关于jquery ajax请求发了,返回值也有,但是却无法进去ajax的success回调函数
- AJAX----回调函数小问题
- discussion about acpi_osi
- android-studio gradle相关知识
- Cordova + Ionic + AngularJS
- Eclipse 替换jar出现ClassNotFound问题
- JavaScript生成八位随机数(含数字、字母、特殊符号)
- ajax回调函数 返回404
- stl源码剖析学习笔记(二)traits编程技法简明例程
- 企业如何降低代码泄露的风险?
- android中SELINUX规则分析和语法简介
- HTML网页超链接title赋一个变量
- 关于Android Studio打包混淆以及上传mapping文件
- xml中出现The processing instruction target matching "[xX][mM][lL]" is not allowed.
- C++ Set常用用法
- CentOS7.1 KVM虚拟化之虚拟机克隆(4)