none
VBScript : the Document object help RRS feed

  • Question

  • Hello everybody

    I am unable run following script using the current browsers.
    please help

    <script language="vbscript" type="text/vbscript">
      var1 = 10 
      var2 = 20
      Sum = var1 + var2  
      document.write("The Sum of two numbers"&_
      "var1 and var2 is " & Sum)
    </script>

    the document object is giving no results.

    Tuesday, June 24, 2014 6:58 AM

Answers

  • Not a good script.  You need to learn how to use HTML.  Running a script like that wil lusually not work.

    Start here: http://www.w3schools.com/

    <script language="vbscript" type="text/vbscript">
    
         Sub window_onload()
              var1 = 10 
              var2 = 20
              Sum = var1 + var2  
              document.write "The Sum of two numbers var1 and var2 is " & Sum
         End Sub
    
    </script>


    ¯\_(ツ)_/¯

    Tuesday, June 24, 2014 10:59 AM

All replies

  • Not a good script.  You need to learn how to use HTML.  Running a script like that wil lusually not work.

    Start here: http://www.w3schools.com/

    <script language="vbscript" type="text/vbscript">
    
         Sub window_onload()
              var1 = 10 
              var2 = 20
              Sum = var1 + var2  
              document.write "The Sum of two numbers var1 and var2 is " & Sum
         End Sub
    
    </script>


    ¯\_(ツ)_/¯

    Tuesday, June 24, 2014 10:59 AM
  • thank you

    the link as well as the answer was very helpful

    i am a beginner.

    Tuesday, June 24, 2014 1:36 PM
  • You are welcome - good luck.

    ¯\_(ツ)_/¯

    Tuesday, June 24, 2014 1:43 PM