工作,我有這樣的jQuery代碼:腳本是不是裏面的jQuery
document.getElementById('geo_us').innerHTML = "<script type='text/javascript' src='http://www.101greatgoals.com/wp-content/themes/tutorial/js/gadout.js'></scr" + "ipt>";
$("#geo_us").append("<div id='div-gpt-ad-1335877669074-0' style='width:160px; height:600px;'></div>");
document.getElementById('div-gpt-ad-1335877669074-0').innerHTML = "<script type='text/javascript' src='http://www.101greatgoals.com/wp-content/themes/tutorial/js/gad.js'></scr" + "ipt>";
這是我得到的結果:外部JS的內容/代碼是不是有..
<div id="geo_us">
<script src="http://www.101greatgoals.com/wp-content/themes/tutorial/js/gadout.js" type="text/javascript">
</script>
<div style="width: 160px; height: 600px;" id="div-gpt-ad-1335877669074-0">
<script src="http://www.101greatgoals.com/wp-content/themes/tutorial/js/gad.js" type="text/javascript">
</script>
</div>
</div>
你知道代碼中出了什麼問題嗎?
謝謝。
@ZenLikeThat我不知道目前使用的任何瀏覽器不支持'getElementById'與黑莓的可能的一般例外,也許Opera Mini的。 – Pointy
你究竟想要做什麼?加載腳本或檢索內容? – Joey