ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: VBScript :: ÈçºÎʹÓà VBScript

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

VBScript
VBScript ½éÉÜ
ÈçºÎʹÓà VBScrip..
VBScript ·ÅÖÃ
VBScript ±äÁ¿
VBScript ³ÌÐò
VBScript Ìõ¼þÓï¾..
VBScript Ñ­»·ÉùÃ..
VBScript ÕªÒª
VBScript ʵÀý
VBScript º¯Êý
VBScript ¹Ø¼ü×Ö

ÈçºÎʹÓà VBScript


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:2021 :: ::

Examples
ʵÀý

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±êÇ©¸ñʽ»¯ÎÄ×Ö


How to Put VBScript Code in an HTML Document
ÔõÑù½«VBScript´úÂë·Å½øHTMLÎĵµÀï

<html>
<head>
</head>
<body>
<script type="text/vbscript">
document.write("Hello from VBScript!")
</script>
</body>
</html>

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>


How to Handle Older Browsers
Åöµ½Àϰ汾µÄä¯ÀÀÆ÷ÔõÑù´¦Àí

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">
<!--

some statements
-->
</script>

ÆÀÂÛ (0) All