大佬教程收集整理的这篇文章主要介绍了为什么写标签会在2.X中触发jQuery.ajaxTransport()?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
var script = $('<script/>',{ id: 're_c',type: 'text/javascript',src: 'https://www.google.com/recaptcha/api/js/recaptcha_ajax.js' }); $('head').append(script);
这由于SOP而失败:
XMLhttprequest cAnnot load https://www.google.com/recaptcha/api/js/recaptcha_ajax.js?legacy. Origin https://ark.dev.hypem.com is not allowed by Access-Control-Allow-Origin. jquery.js:7774 send jquery.js:7774 jQuery.extend.ajax jquery.js:7230 jQuery.extend._evalUrl jquery.js:5810 jQuery.fn.extend.domManip jquery.js:5605 jQuery.fn.extend.append jquery.js:5387 (anonymous function) InjectedScript._evaluateOn InjectedScript._evaluateAndWrap InjectedScript.evaluate Error: NETWORK_ERR: XMLhttprequest Exception 101
看起来像domManip会激活jQuery._evalUrl(node.srC).
同时,$.getScript()正常工作.
var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'https://www.google.com/recaptcha/api/js/recaptcha_ajax.js'; $("head").append( script );
它确实有效,但由于jquery设计,我们无法在某些浏览器上看到它.在Jquery API Documentation,additional notes它说
所以它实际上执行脚本,结果是跨域问题.
以上是大佬教程为你收集整理的为什么写标签会在2.X中触发jQuery.ajaxTransport()?全部内容,希望文章能够帮你解决为什么写标签会在2.X中触发jQuery.ajaxTransport()?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。