2010-11-18 36 views
0

我正在尋找iGoogle小工具中的document.write()媒體資源,如何在iGoogle小工具中執行以下操作?換句話說,我想在一個腳本中使用stdout var。document.write in iGoogle?

Example with document.write()

<html> <body> 

<script type="text/javascript"> var firstname; firstname="Hege"; document.write(firstname); document.write("<br />"); firstname="Tove"; document.write(firstname); </script> 

<p>The script above declares a variable, assigns a value to it, displays the value, changes the value, and displays the value again.</p> 

</body> </html> 

回答

1

只需用CDATA

<?xml  version="1.0"  encoding="UTF-8"?> 
<Module> 
<ModulePrefs title="hello world example" /> 
<Content type="html"><![CDATA[ 
<html> 
<body> 
<script type="text/javascript"> 
var firstname; 
firstname="Hege"; 
document.write(firstname); 
document.write("<br />"); 
firstname="Tove"; 
document.write(firstname); 
</script> 
<p>The script above declares a variable, 
assigns a value to it, displays the value, changes the value, 
and displays the value again.</p> 
</body> 
</html> 
 ]]></Content></Module> 
包圍代碼在內容標記[類型= HTML]