此代码仅适用于Internet Explorer 11,但不适用于Firefox,Chrome,Safari,Opera!在IE中我得到xml / text的响应,但在其他浏览器中我收到错误消息[object Object]!如果我也尝试更改为其他脚本源,甚至IE响应返回[object Object]!
这个cdn根本不起作用:
<!--<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.0.min.js"></script> Microsoft don't work even with IE 11!-->
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> Google not working with no browsers -->
如何让代码与所有网络浏览器一起使用?
这适用于IE 11,但不适用于Firefox,Chrome,Safari,Opera!
<script src="https://code.jquery.com/jquery-latest.min.js"
type="text/javascript"></script>
console.log($.isXMLDoc(text));//viktig
$.ajax({
url: 'https://svenskaspel.se/xternal/xmlegnarader.asp',
processData: false,
type: "POST", // type should be POST
data: text, // send the string directly
// dataType: "text/plain",
success: function(response){
//alert(response);
var one = response.indexOf("<url>");
var two = response.indexOf("</url>");
var url = response.substring(one+5,two);
//alert(url);
window.open(url);
},
error: function(response) {
//alert(response);
}
});