w3pop.com :: ÍøÂçѧԺ :: 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"> |
ÆÀÂÛ (0)
All