`
shendixiong
  • 浏览: 393298 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

ajax随记

阅读更多
//ajax同步请求
 $.ajax({
	        type:"post",
	        async:false,  //设置同步防止数据错误
	        url:dataUrl,
	        data:{"project_id":project_id}
});

 ajax表单提交

$.ajax({
            cache: true,
            type: "POST",
            url:dataUrl, //请求的url
            data:$('#createRuleform').serialize(),// formid
            async: false,
            error: function(request) {
                alert("未能提交");
            },
            success: function(data) {
                if ('false' === data) //提交内容部分
               	{
               		$("#createRuleform").submit();
               	}
                else if ('true' === data)
                {
                	alert('页面提交的内容有重复');
                }
            }
        });

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics