Introduction • Using Java Script, you can enhance a Web page by adding items such as: • Scrolling message • Animations and dynamic images • Data input forms • Pop-up windows • Interactive quizzes
Introduction HTML • Short for HyperText Markup Language, the authoring language used to create documents on the World Wide Web. • HTML defines the structure and layout of a Web document by using a variety of tags and attributes. • The correct structure for an HTML document starts with <HTML><HEAD>(enter here what document is about)</HEAD><BODY> and ends with </BODY></HTML>. All the information you'd like to include in your Web page fits in between the <BODY> and </BODY> tags.
Introduction • There are hundreds of other tags used to format and layout the information in a Web page. • For instance, <P> is used to make paragraphs and <I> … </I>is used to italicize fonts. • Tags are also used to specify hypertext links. These allow Web developers to direct users to other Web pages with only a click of the mouse on either an image or word(s).
Introduction Java • A high-level programming language developed by Sun Microsystems. • Java was originally called OAK, and was designed for handheld devices and set-top boxes. • Oak was unsuccessful so in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web. • Java is an object-oriented language similar to C++, but simplified to eliminate language features that cause common programming errors.
Introduction • Java source code files (files with a .java extension) are compiled into a format called bytecode (files with a .class extension), which can then be executed by a Java interpreter. • Compiled Java code can run on most computers because Java interpreters and runtime environments, known as Java Virtual Machines (VMs), exist for most operating systems, including UNIX, the Macintosh OS, and Windows. • Bytecode can also be converted directly into machine language instructions by a just-in-time compiler (JIT).
Introduction • Java is a general purpose programming language with a number of features that make the language well suited for use on the World Wide Web. • Small Java applications are called Java applets and can be downloaded from a Web server and run on your computer by a Java-compatible Web browser, such as Netscape Navigator or Microsoft Internet Explorer.
Introduction C • A high-level programming language developed by Dennis Ritchie at Bell Labs in the mid 1970s. • Although originally designed as a systems programming language, C has proved to be a powerful and flexible language that can be used for a variety of applications, from business programs to engineering. • C is a particularly popular language for personal computer programmers because it is relatively small -- it requires less memory than other languages.
Introduction • The first major program written in C was the UNIX operating system, and for many years C was considered to be inextricably linked with UNIX. Now, however, C is an important language independent of UNIX. • Although it is a high-level language, C is much closer to assembly language than are most other high-level languages. • This closeness to the underlying machine language allows C programmers to write very efficient code. • The low-level nature of C, however, can make the language difficult to use for some types of applications.
Introduction Compiler • A program that translates source code into object code. • The compiler derives its name from the way it works, looking at the entire piece of source code and collecting and reorganizing the instructions. • Compilers require some time before an executable program emerges. However, programs produced by compilers run much faster than the same programs executed by an interpreter. • Every high-level programming language (except strictly interpretive languages) comes with a compiler.
Introduction Interpreter • An interpreter translates high-level instructions into an intermediate form, which it then executes. • In contrast, a compiler translates high-level instructions directly into machine language. • The advantage of an interpreter is that it does not need to go through the compilation stage during which machine instructions are generated. This process can be time-consuming if the program is long.
Introduction • The interpreter can immediately execute high-level programs. For this reason, interpreters are sometimes used during the development of a program, when a programmer wants to add small sections at a time and test them quickly. In addition, interpreters are often used in education because they allow students to program interactively. • Interpreters are available for most high-level languages. However, BASIC and LISP are especially designed to be executed by an interpreter.
HTML Tags <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd"> <HTML> <HEAD> <META name="Author" content="Dave Raggett"> <TITLE>My first HTML document</TITLE> </HEAD> <BODY> <P>Hello world! </BODY> </HTML>
HTML Tags The HEAD element contains information about the current document, such as its title, keywords that may be useful to search engines, and other data that is not considered document content. Every HTML document must have a TITLE element in the HEAD section. TITLE element to identify the contents of a document. The META element can be used to identify properties of a document (e.g., author, expiration date, a list of key words, etc.) and assign values to those properties. This specification does not define a normative set of properties. Each META element specifies a property/value pair. The name attribute identifies the property and the content attribute specifies the property's value.
HTML Tags The BODY of a document contains the document's content. The content may be presented by a user agent in a variety of ways. For example, for visual browsers, you can think of the body as a canvas where the content appears: text, images, colors, graphics, etc. • TEXT for color of the text • BACKGROUND uses .gif as background of the html page • In HTML tags are in pairs
HTML Tags • INPUT tag for a text box in a FORM for data entry. • Type, Name, Value, and Size are all attributes of the INPUT tag. • Type = “text” indicates that a text box is created. • Name = “PhoneNumber” assigns variable(PhoneNumber) or name to the text box. This variable will store a data entered. • Value will store the initial value to the Type which is text box. • Size=17 indicates the size, which is in characters, of the text box.
HTML Tags More about HTML documentation at web http://www.w3.org/TR/REC-html40/
Cookies • A message given to a Web browser by a Web server. • The browser stores the message in a text file(Navigator- cookies.txt, IE - Cookies folder). • The message is then sent back to the server each time the browser requests a page from the server. • The main purpose of cookies is to identify users and possibly prepare customized Web pages for them. • When you enter a Web site using cookies, you may be asked to fill out a form providing such information as your name and interests. This information is packaged into a cookie and sent to your Web browser which stores it for later use.
Cookies • The next time you go to the same Web site, your browser will send the cookie to the Web server. The server can use this information to present you with custom Web pages. So, for example, instead of seeing just a generic welcome page you might see a welcome page with your name on it. • The name cookie derives from UNIX objects called magic cookies. These are tokens that are attached to a user or program and change depending on the areas entered by the user or program
Cookies • Each cookie is a small item of information with an optional expiration date and is added to the cookie file in the following format: name=value;expires=expDate; name is the name of the datum being stored, and value is its value. • If name and value contain any semicolon, comma, or blank (space) characters, you must use the escape function to encode them and the unescape function to decode them. • expDate is the expiration date, in GMT date format: