2013-01-20 46 views
0

這裏是我的代碼。 我也想知道爲什麼我的搜索只需要一個字。例如,如果我輸入「藍色的天空」,它只會用藍色。如何動態更改我的iframe在document.write中的大小

</script> 

     document.write("<iframe src=\http://www.bing.com/search?q=" + decodeURIComponent(search) + "\"  width=\"100\%\" height=\"500\">"); 
     document.write("</iframe>"); 

     </script> 
+0

爲乘法的話檢查解碼URI組件的功能,看起來這是行不通的正確http://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20 – dmi3y

+0

所以你想動態改變iframe的高度取決於搜索內容? – dmi3y

+0

是的,我想根據搜索內容更改iframe –

回答

0

只是一個類添加到iframe中,你可以用JavaScript,JS與jQuery,CSS等操作它......

+0

感謝您的幫助 –