IPT 31-40

Embed Size (px)

Citation preview

  • 7/29/2019 IPT 31-40

    1/8

    Q31. How to place javascript in HTML page.To insert a JavaScript into an HTML page, use the tag. Inside the tag use thetype attribute to define the scripting language. The and tells where the

    JavaScript starts and ends:My First Web Page

    This is a paragraph.

    ... some JavaScript code ...

    The lines between the and contain the JavaScript and are executed by thebrowser.

    Q32. What is the difference between VBscript and JavaScript?Differences between VBscript and JavaScript are:

    1. JavaScript is the default scripting language for browsers but VBScript must be specified asthe scripting language.

    2. JavaScript has cross-platform support from all popular browsers while VBScript is supported

    MS IE only. VBScripters would thus loose a sizable audience.

    3. One of the most significant issues with JavaScript is that there were different releases ofthe language since its inception (version 1.0). Similarly, different versions of browsers existon users machines. Therefore, code written for one version may not necessarily work onanother. More testing would be necessary thus, development time increases.

    4. JavaScript is case sensitive but VBScript is not this would not be prone to as many syntaxerrors.