当前位置: 首页 > 网络学院 > 客户端脚本教程 > VBScript > 如何使用 VBScript
Write text
How to write text on a page
如何在页面上写些文字
Write text with formatting
How to format the text on your page with HTML tags
如何在页面上通过HTML标签格式化文字
<html> <script type="text/vbscript"> </body> |
And it produces this output:
上面的代码会产生如下结果:
Hello from VBScript! |
To insert a script in an HTML document, use the <script> tag. Use the type attribute to define the scripting language.
要给HTML文档加入脚本,得使用<script>标签。并指明所要使用的脚本语言类型
<script type="text/vbscript"> |
Then comes the VBScript: The command for writing some text on a page is document.write:
接着就可以写VBScript了:能让页面写些文字的命令为:document.write
document.write("Hello from VBScript!") |
The script ends:
脚本结束:
</script> |
Older browsers that do not support scripts will display the script as page content. To prevent them from doing this, you can use the HTML comment tag:
老版本的浏览器不会支持那些页面里的脚本。为了让这些脚本代码不会显示在页面上可以使用HTML的注释标签:
<script type="text/vbscript"> |