我想在創建元素的<script>
元素之後追加元素。它爲http://guubo.com/多分享服務,因此代碼的目的是創建IFRAME元素按鈕。document.body.appendChild在包含JS的地方
guubo = new Object();
// create iframe
guubo.iframe = document.createElement('iframe');
guubo.iframe.setAttribute('style', 'border:none; overflow:hidden; width: 93px; height: 32px;');
guubo.iframe.setAttribute('scrolling', 'no');
guubo.iframe.setAttribute('frameborder', '0');
guubo.iframe.setAttribute('allowTransparency', 'true');
document.body.appendChild(guubo.iframe);
如何運行此代碼<script>
後guubo.iframe
元素追加?請注意,頁面上可能會有多個<script>
,並且具有相同的URL,因此搜索具有相同URL的腳本元素並在其不是選項之後追加。
那麼問題是什麼? – lonesomeday 2011-06-07 11:36:07
那麼該怎麼做? – Gajus 2011-06-07 11:36:34
你怎麼做? – circusbred 2011-06-07 11:38:16