How to Write Script Files

People write script files to enhance Web pages. They are simply collections of computer vocabulary comprised of signs and symbols. Browsers use these signs and symbols to distinguish different pieces of information (To a computer, a video or image is basically the same thing.). Write script files by using these signs and symbols to construct a Web page of your own. It will increase the functionality of your Web page. Hypertext markup language (HTML) is also a batch of vocabulary to help write script files. You should learn a bit about HTML before attempting to write script files. Patterns in scripts are modeled after the patterns in HTML.

Things You'll Need

  • Notepad or WordPad
Show More

Instructions

    • 1

      Open a new Notepad or WordPad file and save it to your desktop with the extension "html". Go into your new file by right-clicking the icon. A menu will appear. Click the phrase "Open With" and then click "Notepad" or "WordPad", depending on which application you use.

    • 2

      Place "<html><body>" at the top of your opened page. Put the symbol "</body></html>" just below that. Your script files will eventually go in between the HTML signs and symbols. Make sure you use left and right angle brackets. This is how Internet browsers distinguish between markups (clues that tell computers and browsers what a piece of information should look like) and scripts (which tell the marked information how to run).

    • 3

      Write scripts between your HTML symbols. Start by telling an Internet browser what language you are using with this: "<script type="text/javascript">" or <script type="text/vbscript>". The string could look like this: <html><body><script type="text/javascript"></script></body></html>". Prepare to tell your computer what sentences will appear on your Web page. Text inside angle brackets do not show up while text outside the angle brackets will. If you opt to use "text/vbscript" instead of "text/javascript", do not use a semicolon.

    • 4

      Type "document.write" underneath the "script type="text/javascript". Place parentheses and quotes with a semicolon at the end of your text line like this: "<script type="text/javascript">document.write("This sentence will appear on the page!");</script>". A good example could look like this: <html><body><script type="text/javascript">:"<script type="text/javascript">document.write("This sentence will appear on the page!");</script></script></body></html>." Make sure there is not a space between the "e" in "write" and the parenthesis next to it. Your computer will misinterpret the language and not give you the results you want. Save your work and close out of your file. Review your scripts by double-clicking the Web page icon.

Learnify Hub © www.0685.com All Rights Reserved