防止跨域方式调用JS
<script type="text/javascript">
document.domain = "aaa.com";
if (typeof (bitLoadScript) == "undefined")
bitLoadScript = function (url, callback, charset) {
var s = document.createElement("script");
s.type = "text/javascript";
if (charset) s.charset = charset;
if (s.readyState) {
s.onreadystatechange = function () {
if (s.readyState == "loaded" || s.readyState == "complete")
{ s.onreadystatechange = null; if (callback) callback(); }
};
}
else {
s.onload = function () {
if (callback) callback();
};
}
s.src = url;
document.getElementsByTagName("head")[0].appendChild(s);
};
// 调用
// bitLoadScript("http://aaa.com/ssss.ashx", null, "utf-8");
// bitLoadScript("http://aaa.com/ssss.js?v=3.0", null, "utf-8");
// 重复调用bitLoadScript("http://aaa.com/201001/usercars.js",
function(){
viewedcars();
bitLoadScript("http://aaa.com/201001/usercarlife.js",function(){bitLoadScript("http://aaa.com/bitautoforum/userforum.js",usercarlife ,"utf-8");},"utf-8");},"utf-8");
</script>