开发者

document.write in iGoogle?

开发者 https://www.devze.com 2023-01-25 21:07 出处:网络
I am looking for document.write() property in iGoogle gadgets, how can I do the thing below in iGoogle gadget? In other words, I want stdout var in a script.

I am looking for document.write() property in iGoogle gadgets, how can I do the thing below in iGoogle gadget? In other words, I want stdout var in a script.

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, assig开发者_运维技巧ns a value to it, displays the value, changes the value, and displays the value again.</p>

</body> </html>


Simply enclose the code in a Content tag [type=html] with a 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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号