YML19971997 2019-06-21 15:57 采纳率: 0%
浏览 528

在插入一个新用户的时候一直显示网络错误

图片说明这一段出错,是这个文件有问题吗图片说明

if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("&quot;).attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on(&quot;load error&quot;,i=function(e){r.remove(),i=null,e&amp;&amp;t(&quot;error&quot;===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&amp;&amp;i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&amp;|$)|\?\?/;k.ajaxSetup({jsonp:&quot;callback&quot;,jsonpCallback:function(){var e=Gt.pop()||k.expando+&quot;_&quot;+kt++;return this[e]=!0,e}}),k.ajaxPrefilter(&quot;json jsonp&quot;,function(e,t,n){var r,i,o,a=!1!==e.jsonp&amp;&amp;(Yt.test(e.url)?&quot;url&quot;:&quot;string&quot;==typeof e.data&amp;&amp;0===(e.contentType||&quot;&quot;).indexOf(&quot;application/x-www-form-urlencoded&quot;)&amp;&amp;Yt.test(e.data)&amp;&amp;&quot;data&quot;);if(a||&quot;jsonp&quot;===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,&quot;$1&quot;+r):!1!==e.jsonp&amp;&amp;(e.url+=(St.test(e.url)?&quot;&amp;&quot;:&quot;?&quot;)+e.jsonp+&quot;=&quot;+r),e.converters[&quot;script json&quot;]=function(){return o||k.error(r+&quot; was not called&quot;),o[0]},e.dataTypes[0]=&quot;json&quot;,i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&amp;&amp;(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&amp;&amp;m(i)&amp;&amp;i(o[0]),o=i=void 0}),&quot;script&quot;}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument(&quot;&quot;).body).innerHTML=&quot;<form></form><form></form>&quot;,2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return&quot;string&quot;!=typeof e?[]:(&quot;boolean&quot;==typeof t&amp;&amp;(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument(&quot;&quot;)).createElement(&quot;base&quot;)).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&amp;&amp;[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&amp;&amp;o.length&amp;&amp;k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(&quot; &quot;);return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>&quot;).append(k.parseHTML(e)).find(r):e)}).always(n&amp;&amp;function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each([&quot;ajaxStart&quot;,&quot;ajaxStop&quot;,&quot;ajaxComplete&quot;,&quot;ajaxError&quot;,&quot;ajaxSuccess&quot;,&quot;ajaxSend&quot;],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,&quot;position&quot;),c=k(e),f={};&quot;static&quot;===l&amp;&amp;(e.style.position=&quot;relative&quot;),s=c.offset(),o=k.css(e,&quot;top&quot;),u=k.css(e,&quot;left&quot;),(&quot;absolute&quot;===l||&quot;fixed&quot;===l)&amp;&amp;-1&lt;(o+u).indexOf(&quot;auto&quot;)?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&amp;&amp;(t=t.call(e,n,k.extend({},s))),null!=t.top&amp;&amp;(f.top=t.top-s.top+a),null!=t.left&amp;&amp;(f.left=t.left-s.left+i),&quot;using&quot;in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if(&quot;fixed&quot;===k.css(r,&quot;position&quot;))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&amp;&amp;(e===n.body||e===n.documentElement)&amp;&amp;&quot;static&quot;===k.css(e,&quot;position&quot;))e=e.parentNode;e&amp;&amp;e!==r&amp;&amp;1===e.nodeType&amp;&amp;((i=k(e).offset()).top+=k.css(e,&quot;borderTopWidth&quot;,!0),i.left+=k.css(e,&quot;borderLeftWidth&quot;,!0))}return{top:t.top-i.top-k.css(r,&quot;marginTop&quot;,!0),left:t.left-i.left-k.css(r,&quot;marginLeft&quot;,!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&amp;&amp;&quot;static&quot;===k.css(e,&quot;position&quot;))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:&quot;pageXOffset&quot;,scrollTop:&quot;pageYOffset&quot;},function(t,i){var o=&quot;pageYOffset&quot;===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&amp;&amp;(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each([&quot;top&quot;,&quot;left&quot;],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+&quot;px&quot;:t})}),k.each({Height:&quot;height&quot;,Width:&quot;width&quot;},function(a,s){k.each({padding:&quot;inner&quot;+a,content:s,&quot;&quot;:&quot;outer&quot;+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&amp;&amp;(r||&quot;boolean&quot;!=typeof e),i=r||(!0===e||!0===t?&quot;margin&quot;:&quot;border&quot;);return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf(&quot;outer&quot;)?e[&quot;inner&quot;+a]:e.document.documentElement[&quot;client&quot;+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body[&quot;scroll&quot;+a],r[&quot;scroll&quot;+a],e.body[&quot;offset&quot;+a],r[&quot;offset&quot;+a],r[&quot;client&quot;+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each(&quot;blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu&quot;.split(&quot; &quot;),function(e,n){k.fn[n]=function(e,t){return 0&lt;arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,&quot;**&quot;):this.off(t,e||&quot;**&quot;,n)}}),k.proxy=function(e,t){var n,r,i;if(&quot;string&quot;==typeof t&amp;&amp;(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=N,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return(&quot;number&quot;===t||&quot;string&quot;===t)&amp;&amp;!isNaN(e-parseFloat(e))},&quot;function&quot;==typeof define&amp;&amp;define.amd&amp;&amp;define(&quot;jquery&quot;,[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&amp;&amp;(C.$=Jt),e&amp;&amp;C.jQuery===k&amp;&amp;(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k});</p> <p>$.ajax({<br> type: &quot;post&quot;,<br> url: getPath() + &quot;/registerUser&quot;,<br> async: false,<br> dataType:&#39;json&#39;,<br> contentType: &#39;application/json&#39;,<br> data:JSON.stringify({&quot;id&quot;:0,&quot;name&quot;:userName,&quot;password&quot;:userPassword,&quot;email&quot;:userEmail,&quot;role&quot;:false}),<br> success: function (data) {<br> if (data.flag) {<br> $(&#39;#userName&#39;).addClass(&#39;is-valid&#39;);<br> $(&#39;#userPassword&#39;).addClass(&#39;is-valid&#39;);<br> $(&#39;#userEmail&#39;).addClass(&#39;is-valid&#39;);<br> $(&#39;#userPasswordCheck&#39;).addClass(&#39;is-valid&#39;);<br> $(&#39;#registerResult&#39;).addClass(&#39;alert alert-success&#39;);<br> $(&#39;#registerResult&#39;).html(&#39;注册成功!跳转至<a href="login.html">登录</a>界面&#39;)<br> setTimeout(window.location.href = &#39;login.html&#39;, 5000);</p> <pre><code> } else { alert(&#39;注册失败&#39;); } }, error: function () { alert(&quot;网络错误&quot;); } }) } </code></pre>

  • 写回答

1条回答 默认 最新

  • 毕小宝 博客专家认证 2019-06-21 16:15
    关注

    你搜一下浏览器调试的方法,按 F12 打开浏览器开发者模式,目测这个请求应该是有问题的,可能是URL路径错误或者其他的。
    具体看下浏览器的 console 的输出信息是什么具体定位下根源。

    评论

报告相同问题?

悬赏问题

  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示