Javascript revealed

You want to have an action when the mouse rolls over the button; how to generate a completely different dynamic web page based on different times of the day; or when the visitor enters an error message, refuses to log on; Javascript can achieve all of the above, even More. Many websites currently use Javascript to create scrolling status bar information, remote panels, flipped buttons, and other clever use of Javascript. You may disregard this and think that Javascript is only suitable for making second-rate websites. But the function of Javascript is far more than this. Next, we will introduce how to use Javascript to edit various types of web images, how Javascript works, and how it plays an important role in creating a new generation of web pages.

What is Javascript?
Javascript is a programming language developed by Netscape Corporation and originally marketed with Netscape 2.0. It was also called "Livescript" at the beginning, which means that it provides scripting features as part of Netscape's LiveWire Web dynamic web application and development environment. Later, due to the great success of the Java language, it was renamed "Javascript" in 1995.

Javascript was initially designed as an easy-to-use scripting language that helps Web developers design better HTML pages. This positioning makes it different from Java and other traditional programming languages ​​for the Internet. It does not require developers to have a wealth of programming experience. Many people without programming experience regard Javascript as a low-level Java or non-professional Web programming language. Because of this, Javascript is not suitable for writing advanced web applications.

HTML developers and others with little or no programming background often misunderstand Javascript. They think of Javascript as a black box. Simply pasting an encapsulated script onto a page can produce fancy page modification effects. In fact, the Javascript function is not only these, it really needs some programming skills to discover the full potential of Javascript.

Why use Javascript?
There are many ways we can program static Web pages and convert them into dynamic Web pages. One commonly used method is to apply a CGI program that resides on a Web server and executes on it. Users can interact with Web sites by filling out an HTML-based form and submitting it to CGI applications. The CGI application accepts this input, performs some functions, and finally returns the results to the user as a web page. This style of web design method is suitable for database query, search engine and directory search.

However, some users complain that CGI programs are too slow and cannot save relevant information when the web page is switched. This is not the only problem with CGI technology. Other technologies also exist, but this is not their own fault. There are two reasons for this phenomenon: First, the language used to write CGI programs. If you use the C and PERL source code to generate the same CGI program, the former will be slower than the latter. The second is that many operating systems repeatedly execute multiple copies of the same CGI program, which constantly takes up system resources and processes, and the speed will certainly be slow.

Netscape's API (application programming interface), Microsoft's Internet Server Application Programming Interface (ISAPI), and Apache modules are all improved server-side design methods. Although they can solve most of the problems of CGI, they still have a basic Problem: The server must take all the work. When there are too many tasks to download, there may be a "bottleneck" (server crash).

In addition, all tasks are given to the server. This design can potentially reduce work efficiency. For example, you order shoes from an online shoe store. You accidentally typed 48 yards in the form's shoe code field, but in fact it's impossible to have a shoe of this size. Despite errors, forms can and will be submitted to the server, which wastes time dealing with a "false" request. Therefore, the correctness of the form data should be checked before submitting the form. This will give the viewer a “user friendly” feeling and will offload part of the server load.

Although Javascript is designed for this purpose, it is not just a simple form-confirmation language. Think of Javascript as a "glue" that brings together all Web page elements on the client side. It allows you to easily define what browsers to use, what plug-ins to load, and other tasks required to construct a dynamic web page. With the promotion of Netscapt's dynamic connection technology, Javascript is gradually becoming a tool for controlling and interacting with objects such as plug-ins, layers, frames, style sheets, and Java programs of Web pages. Although people haven't fully realized the "glue" feature of Javascript, in the near future, the importance of Javascript will surely exceed HTML itself.

How to use Javascript?
There are two basic types of Javascript: Javascript written on the client side and Javascript compiled on the server side. The server-side Javascript is a high-level product of Netscape's LiveWire, which is not easy to master, and the client's Javascript is more acceptable to Web users. So we will focus on the client's Javascript. The client's Javascript is the set of commands inserted in the HTML page, usually inserted between tags. Although there is no difference in appearance between a web page that calls Javascript and a plain HTML page, HTML only defines the layout, structure, embedded objects, and connections between texts, and Javascript adds logic and programming tools.

There are three basic places in the HTML file to add Javascript: within the markup, within the markup, and within the markup are some special forms of elements. When a browser that can recognize Javascript reads a web page that contains Javascript, the browser interprets the Javascript command line by line and performs the corresponding operation. Some commands, such as commands that insert dates at the bottom of a web page, are executed immediately by the browser; other commands that require user actions (such as pressing the submit button) are delayed by the browser until the action is completed.

The relatively simple syntax of Javascript makes it very familiar to people who have used C language. By using an appropriate object reference to control multiple objects in a browser (window, frame, form, history list, etc.) by Javascript, this is the basic concept of Javascript, as long as you grasp this concept, the process of learning Javascript will be It's very simple.

Objects have inherent qualities called attributes, and object-oriented programming methods are powerful and easy to modify. If we use object-oriented concepts in the browser domain, we can think of the browser itself as a collection of objects, including browsers, windows, frames, documents, forms, and form elements.

For example, a browser window is designed as an object, which is correspondingly referred to as a "window." A window has many different properties, including a status bar at the bottom of the screen, showing information that can be viewed and modified. You can add Javascript commands in the status bar by using appropriate commands, such as windows.status="HELLO WORLD".

Javascript also has built-in features called "methods." Objects can implement a common task by calling methods. For example, if you want to make a popup dialog box, you can use the window.alert "Hello World" command on the window object, so that you can pop up a dialog box with the content "HELLO WORLD".

There are many properties and methods in Javascript. Only after you understand all the options can you really master them. Don't worry about Javascript's object-oriented programming methods, because using Javascript is very simple and procedural, just like other languages.

Note: Old browsers that do not recognize Javascript will output the Javascript code as they are on the web page. So you must be very "careful" and comment out Javascript script code with HTML and Javascript annotations if necessary. Netscape (2.0 or later) and Microsoft IE 3.0 are the only browsers that currently support Javascript.

Inconveniently, these two browsers do not support Javascript in the same way, but Javascript "dialects" continue to appear, and there are cross-platform incompatibility issues. Microsoft's Javascript (JScript) is considered to be a clone of Javascript because it is similar to Javascript 1.0 (Javascript used in Netscape 2.X). On the other hand, Netscape3.X (using Javascript1.1) is the only browser that supports the new features of Javascript. These new features include dynamic image settings that can be used to create animated buttons.

Both Netscape and IE4.0 have added some features of Javascript, but there are some differences between Javascript. Javascript's specification update is very fast, and the difference between the browsers that support it is quite large, so use it carefully according to the browser you choose. Remember to thoroughly test your web page to ensure it is completely safe.

The key to using Javascript correctly is to know where on the page and how to add Javascript code. We can use Javascript to add some simple animated buttons, pop-up windows, and scrolling status bar to the page, and use these small props to decorate the page. Even if you haven't learned programming, you can copy and paste the script code on the page.

Only by comparing Javascript with other technologies such as HTML, ActiveX, CGI, plug-ins, Java, etc., can you discover the true advantages of Javascript: it can display static Web pages dynamically. Through examples of static and dynamic web pages on the web, we can conclude that as a Web design tool, Javascript is as important as HTML.

Vacuum Can Coolers

Stainless Steel Vacuum Can Coolers are made from high-grade 18/8 stainless steel. This material is food grade, non-toxic, durable and easy to clean.

And we got a lot of different kinds of Stainless Steel Bottles. For example: Stainless Steel Cola Bottle, a classic design that is popular in the market and easy to use, also looks good. Speaking of looking, our Cola Bottle comes in changeable colors and diverse patterns.

Double Walled Vacuum Can Cooler,Vacuum Insulated Can Cooler,Promotional Vacuum-Insulated Can, 12oz Vacuum Can Cooler,Vacuum Insulated Stainless Steel Can Cooler

Ningbo Auland International Co.,Ltd. , https://www.eversportsbottle.com

Posted on