Question 1: Functions of JavaScript in HTML

HTML is a type of technology that is used by many websites to create visually engaging web pages and user interfaces. JavaScript is an object scripting language that is used in web pages along with mark to language HTML. JavaScript requires a web page as a medium for it to be displayed. HTML can only display static web pages and the life to these web pages is given by the JavaScript.  HTML creates objects while JavaScript lets you manipulate them.  In order to add JavaScript to a web page, all one needs to do is include JavaScript code as a HTML file. JavaScript brings out all the special functionalities in a client’s browser rather than the site’s browser.

When a web page is loaded, the browser creates a Document Object Model (DOM) of the page. The DOM is a language-independent convention that represents and interacts with objects in HTML. With the object model, the JavaScript is now completely allowed to generate dynamic HTML. With that, the JavaScript is allowed to add, change or remove all the HTML elements in the page. JavaScript is simply the language and enables the language in a HTML page to be interpreted and understood by the user.

Question 2: HTML and Java Applets

An applet is a Java Program embedded in a web page that has an <applet> or <object> tag embedded in it. The <applet> tag enables a user that has Java Programs on the web to create interactive graphics. It also allows the user to specify the location of the file they would like to run, and the height and width of the applet inside the page. A user can also specify the values of the various perimeters that they want to use. The applets can also help in coming up with an alternate HTML code just in case the browser does not support the applets.

. An applet is well suited for functions like visualization and demonstration. When a user visits a HTML page that is embedded with an applet, the code for the applet is downloaded into the user’s machine. Applets have strict security rules that are enforced by the web browser.  A java Applet can be combined with HTML to create a Java Program that can run inside the web browser. Java applets are executed in a sandbox by most web browsers which prevents them from accessing local data or file systems. The code of the applet is downloaded from a web server and the browser embeds it into the web page b or opens a new window showing the applet’s user interface.

The Java applet comes with class file (.class). this file has to be the web page for the applet to work. This file come with an applet program is ready to use. Having the .class file on the site you are visiting is not enough. One needs to input a HTML code in the page that the applet will be run. The HTML code is what the applet program creates. The HTML code tells the .class file how to customize the applet. Thee customization may include things like clor, size, the images that are needed and many more.

 

 

 

 

References

Anil H. (2000) Applets: Still Essential to Java (How do applets fit into the big picture now) retrieved from www.javaworld.com/article/20176251/core-java/applets-still-essential-to-java-.html

 

All Rights Reserved, Essaysland.com
Disclaimer: