C.M.R College Of Engineering & Technology
A Scripting language that is designed primarily for people who are building WebPages using HTML.
The script is interpreted by browser
3)Performing complex calculations
It allows interaction with the properties of objects that it recognizes.
Internal built-in objects(e.g. window object).
Browser object(e.g. document object).
By the browser after downloading the HTML document.
Requires Netscape livewire environment. Slide 5: Although the names resembles quite closely, they are different languages
1.Both are object oriented languages.
2.Java script programs are interpreted in source code form.
5.Java is a powerful language can be used in extremely sophisticated applications.
7.Java is strongly typed language.
. object Slide 9: A simple example of property is color, which rather easy to visualize.
They can be directly manipulated by referring to the object and the property by the name and then setting it’s value.
For example, the background color of a page can be changed as :
document.bgcolor=“blue”; Slide 10: In the object oriented paradigm, methods refer to functions that can be used to manipulate objects and their properties.
the methods write(),which when invoked on the document object causes a specific strong of characters to outputted.
document. write(“hello good day”); Slide 11: Methods which are defined on an object give the range of choices available for interacting with the object.
1.A window object can be opened or closed using the open() and close() methods respectively.
2.A form object has a submit() method which transmits the contents of the form to the web server. Slide 12: 3.History object ,which has forward() and backward() methods to move through the list.
Apart from the pre-defined methods it is also possible to create userdefine functions.
1.Control the rate with which a line of text scrolls across the screen.
2.Determine the path of an animated object across the display.
The <script> tag is used.
----- -- >
</script></head><body>----</body></html> Example 1 : Example 1 Simple message output varying in sizes.
Document.writeln(“<h1>hello good day</h1>”);
Document.writeln(“<h3>best of luck</h3>”);