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);} 实际就是把iframe换成script而已,效率高,代码简单,兼容性好 转载于:https://www.cnblogs.com/Iamlein/archive/2008/05/07/2375943.html