Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

VB Script Tutorials- Introduction

By Exforsys | on April 20, 2006 |
VBScript Tutorial

VB Script – Introduction

Vb Script tutorials will be covered in the following topics which are given below :

• What is VB Script ?
• Working with Variables?
• Objects and VB Script ?
• Controlling VB Script Routines ?
• Using VB Script with Forms?

In this tutorial you will learn about VB Script – What is VB Script ? Introduction, Description, How to Add VB script to web pages ? The Script Tag, How to handle Non Supporting Browsers and Conclusion

What is VB Script ?

Introduction :

VB Script is a scripting language developed by Microsoft. With the help of this scripting language you can make your web pages more dynamic and interactive.
VB Script is a light version of Visual basic and it has an easy syntax.

Description :

VB Script is widely used and most popular as a client side scripting language. In html language you use < and > around the tags. But you can use many tags inside one pair of < % and % >. For Printing a variable you can use < % = % >.

How to Add VB script to web pages ?

There are scripting languages like Javascript and Vbscript and they are designed as an extension to html language.The Web browsers like Microsoft Internet Explorer receives the scripts along with the rest of the web page document. It is the browser responsibility to parse and process the scripts. These scripts are widely used as a client side scripting languages. Now you will start learning how the Script language works and we will show you step by step . So just concentrate on the further topics.

The Script Tag

When ever you want to add scripts in your web pages you are preparing you have to use < script > starting tag and < / script > ending tag where the script is going to close. The example of this is shown below :

< html >
< head >
< title >vbscript example< /title >
< script language=”vbscript” >
Msgbox “Welcome to the world of VB Script”
< /script >
< /head >
< body >
< /body >
< /html >

I have used the example with a simple going “Welcome to the world of vbscript” as there is a tendency whenever a new learner is learning a new language we always welcome him.

Well, in the above example you have seen the language attribute. We have used VbScript as the scripting language.This Argument is required as there are more than one scripting language. Without the language argument, browser would not able to know if the text between the tags was vbscript or javascript or any other scripting language.

As the Script is totally dependent on the browser so next question arises is “ How to handle Non Supporting browsers”. If the client browser has disabled the script than your web page might now function properly. So for your advantage you can also the server side language. As the server side language is far from the scope of this tutorial.

How to handle Non Supporting Browsers

As not all browsers are compatible for scripting languages . As Vbscript is only supported by Microsoft Internet Explorer.So you might be thinking of the Non Supporting browsers. The Non Supporting browsers does not know how to handle this script part, so they will display all the script as part of your text on a web page. To resolve this Issue you can encase your script in the Comments tag as given in the below example.

< html >
< head >
< title >vbscript example< /title >
< script language=”vbscript” >
Msgbox “Welcome to the world of VB Script”
< /script >
< /head >
< body >
< /body >
< /html >

Now, When the Web browsers that does not support the scripting language will view your script as a comment and will simple ignore it.

The easiest way to learn any new language is to work on it.So we will use maximum examples so that you can practice more.

< html >
< head >
< title >First vbscript example< /title >

< /head >
< body >
< form name="firstexample" >
< Input type="button" name="cmdclickMe" value="Just Click" >
< SCRIPT FOR="cmdClickMe" EVENT="onClick" LANGUAGE="VBScript" >

MsgBox "A simple example of VBScript in action."

< /SCRIPT >

< /form >
< /body >< /html >

Save the above code with any name but with the extension .html and run it in your browser.You will see the result like in the below picture when you click button Just Click. This is functionality of the script.

 

As in the above example we have the script just after the html button created. But this is not the preferred approach and will lead to confuse state when the web pages are too large. So to avoid complexity and to ease the readablitiy of the web page document the below given approach is far better.

< html >
< head >
< title >First vbscript example< /title >
< SCRIPT LANGUAGE="VBScript" >

Sub cmdclickMe_onClick

MsgBox "A simple example of VBScript in action."

End Sub

< /SCRIPT >

< /head >
< body >
< form name="firstexample" >
< Input type="button" name="cmdclickMe" value="Just Click" >

< /form >
< /body >< /html >

I will explain you how it is working.The only difference of this code from the above code is that we have shifted our script tag to the head section in the html for easy readability. Just read the script tag here we have defined a sub procedure called cmdclickMe . This will be executed everytime the button is clicked as onClick event is attached with it. It means the script has to be executed everytime the button is clicked. Its simple.The output generated will be the same as in the previous example.

Conclusion

We have learned how to add script to the web pages.
How to make your script not available to the non supporting browsers.

« « C Programming – Handling of Character String
VB Script – Working with Variables » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 394 Followers
  • Popular
  • Recent
  • VB Script – Working with Variables

    April 20, 2006 - 0 Comment
  • Working with Objects in VB Script

    April 20, 2006 - 0 Comment
  • VB Script – Controlling VB Script Routines

    April 29, 2006 - 0 Comment
  • VB Script – How to use VBScript with Forms

    April 29, 2006 - 0 Comment
  • VB Script – How to use VBScript with Forms

    April 29, 2006 - 0 Comment
  • VB Script – Controlling VB Script Routines

    April 29, 2006 - 0 Comment
  • Working with Objects in VB Script

    April 20, 2006 - 0 Comment
  • VB Script – Working with Variables

    April 20, 2006 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • VB Script – How to use VBScript with Forms
  • VB Script – Controlling VB Script Routines
  • Working with Objects in VB Script
  • VB Script – Working with Variables

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT