如何将jQuery的JSONP方法改写为长尾?
- 内容介绍
- 文章标签
- 相关推荐
本文共计167个文字,预计阅读时间需要1分钟。
javascriptgistfile1.txtfunction ajaxRequest(opurl, formname, reviewType) { $.ajax({ type: 'post', url: opurl, data: $(formname).serialize(), success: function(data) { // 处理响应数据 } });}
function ajaxRequest(opurl,formname,reviewType){ $.ajax({ type:'post', url:opurl, data:$('#'+formname).serialize(), dataType:'jsonp', jsonp:"jsoncallback", success:function(data){ var flag = data.flag; var msg = data.msg; var flag = data.flag var comId =data.comId; if(flag=='T'){ alert('信息提交成功!'); }else{ alert(msg); } if(reviewType=='zczx'){ $("#userCname").val(''); $("#userPhone").val(''); $("#comTitle").val(''); $("#context").val(''); } if(reviewType=='wybm'){ $("#orgName").val(''); $("#socialCreditCode").val(''); $("#scopeBusiness").val(''); $("#legalPerson").val(''); $("#telephone").val(''); $("#contactName").val(''); $("#contatTelphone").val(''); $("#contactEmail").val(''); $("#addressZipcode").val(''); window.location.href="/sys/baoming.shtml?comId="+comId+"&backurl="+window.location.href; } if(reviewType=='upwybm'&& flag=='T'){ $("#registeredAddress").val(''); $("#registeredCapital").val(''); $("#legalPersonCategory").val(''); window.location.href=backurl; } $("#rand").val(''); //刷新验证码 document.getElementById('timecode').src='/image.jsp?temp='+ (new Date().getTime().toString(36)); }, error:function(){ alert("提交失败!"); } }); }
本文共计167个文字,预计阅读时间需要1分钟。
javascriptgistfile1.txtfunction ajaxRequest(opurl, formname, reviewType) { $.ajax({ type: 'post', url: opurl, data: $(formname).serialize(), success: function(data) { // 处理响应数据 } });}
function ajaxRequest(opurl,formname,reviewType){ $.ajax({ type:'post', url:opurl, data:$('#'+formname).serialize(), dataType:'jsonp', jsonp:"jsoncallback", success:function(data){ var flag = data.flag; var msg = data.msg; var flag = data.flag var comId =data.comId; if(flag=='T'){ alert('信息提交成功!'); }else{ alert(msg); } if(reviewType=='zczx'){ $("#userCname").val(''); $("#userPhone").val(''); $("#comTitle").val(''); $("#context").val(''); } if(reviewType=='wybm'){ $("#orgName").val(''); $("#socialCreditCode").val(''); $("#scopeBusiness").val(''); $("#legalPerson").val(''); $("#telephone").val(''); $("#contactName").val(''); $("#contatTelphone").val(''); $("#contactEmail").val(''); $("#addressZipcode").val(''); window.location.href="/sys/baoming.shtml?comId="+comId+"&backurl="+window.location.href; } if(reviewType=='upwybm'&& flag=='T'){ $("#registeredAddress").val(''); $("#registeredCapital").val(''); $("#legalPersonCategory").val(''); window.location.href=backurl; } $("#rand").val(''); //刷新验证码 document.getElementById('timecode').src='/image.jsp?temp='+ (new Date().getTime().toString(36)); }, error:function(){ alert("提交失败!"); } }); }

