另类思路:不用xmlhttp或者iframe来实现ajax操作
function sptOps(str){
var url = '/product/index/sa?'+str;
var element = document.createElement("script");
element.setAttribute("language", "javascript");
element.setAttribute("src", url);
document.body.appendChild(element);
}
var url = '/product/index/sa?'+str;
var element = document.createElement("script");
element.setAttribute("language", "javascript");
element.setAttribute("src", url);
document.body.appendChild(element);
}
实际就是把iframe换成script而已,效率高,代码简单,兼容性好