iGoogle 中的 document.write ?

发布于 2024-10-03 01:23:01 字数 650 浏览 1 评论 0原文

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

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>

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, assigns a value to it, displays the value, changes the value, and displays the value again.</p>

</body> </html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空袭的梦i 2024-10-10 01:23:01

只需将代码包含在带有 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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文