首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iGoogle中的document.write?

iGoogle中的document.write?
EN

Stack Overflow用户
提问于 2010-11-18 08:34:35
回答 1查看 109关注 0票数 0

我正在寻找iGoogle小工具中的document.write()属性,我如何在iGoogle小工具中做下面的事情?换句话说,我希望在脚本中包含stdout var。

Example with document.write()

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-11-18 15:00:04

只需使用CDATA将代码包含在内容标记type=html中

代码语言:javascript
复制
<?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>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4212333

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档