Thursday, 19 February 2015

Website can be created well enough by HTML and CSS. But what if the capabilities of plain HTML are simply not enough to create the Web pages you want? Then you will probably turn to scripting and the Document Object Model (DOM). When used together, scripting and the DOM are sometimes referred to as dynamic HTML, or DHTML. We can’t provide complete coverage of scripting and the DOM in a single chapter, but will give you a good introduction and let you explore more on your own if you want to.

A script is a program that is embedded in a Web page. It is kept separate from the page’s HTML by special tags. The script code is executed when certain events occur, such as the page loading into a browser or the user clicking an element on the page. A script can perform a wide variety of actions, such as processing text data , displaying messages to the user, controlling the browser, and changing the appearance of the page. There are also many things scripts can’t do, such as read files on your hard drive or access your system’s memory. These limitations are international and have been put for security reasons. Without access to files and memory, it is essentially impossible for a script to cause any mischief on the user’s computer. The scripts that are covered in this chapter are called client-side scripts because they are downloaded as part of a Web page and executed on the client’s computer. You might have also heard about server-side scripts, which are executed remotely on the Web server, but that’s different topic. By far the most popular scripting language is JavaScript, and that’s what we will use in this section. Another commonly used scripting language is VBScript that has certain syntax similarities with the Visual Basic programming language. If you already know Visual Basic, you might find VBScript a bit to learn. However, we still recommend JavaScript.

0 comments:

Post a Comment