我正在嘗試製作一個腳本,它將在頁面中注入一個標籤。JavaScript讓瀏覽器永久加載並崩潰Safari
這就是:
<script type="text/javascript" charset="utf-8">
var url = 'http://my_url.com/js/widget_rss.js?cle=4c65683101e22&host=' + window.location.hostname;
var scriptTag = document.createElement('script')
scriptTag.src = url;
var head = document.getElementsByTagName("head")[0];
(head || document.body).appendChild(scriptTag);
</script>
它工作時,它會調用其他的文件和文件運行,但它使永遠的瀏覽器加載...
任何想法有什麼錯呢?
謝謝!
順便說一句,你可以使用延遲加載這個http://github.com/rgrove/lazyload – 2010-08-13 19:12:54
有可能是你想加載的腳本有問題。你能發佈它的代碼嗎? – ntownsend 2010-08-13 20:13:41