iGoogle中的document.write?

时间:2010-11-18 00:34:35

标签: javascript stdout igoogle

我在iGoogle小工具中寻找document.write()属性,如何在iGoogle小工具中执行以下操作?换句话说,我想在脚本中使用stdout var。

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 个答案:

答案 0 :(得分:1)

只需将代码封装在带有CDATA

的内容代码[type = html]中
<?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>