JavaScript can be used to detect plug-ins in a Web browser, but it is worth noting that it is only valid in Netscape Navigator. The following code shows how to probe the Audio/midi type plug-in program:
How do you call it on the Web? Here's the code:
"Stopsound ()" >
height= ">http://jhsy.82676666.com/renliushuqian/120.html" border= "0"
You may be familiar with some other programming languages, such as C + + or Java and so on, they can also create objects, now the latest VB version vb.net also has better object-oriented features-----to create objects. Essentially, the idea of creating an object is simply to create a simple entity that contains many properties and methods. The following is an example of an object constructor:
function person (name, age, colour) {
THIS.name = name;
This.age = age;
This.colour = colour;
}
Then we can call the person constructor like this:
var somebody = new Person ("Patrick", "Red");
Or get input values from the user:
var pName = prompt ("What's your Name?");
var page = prompt ("How old is the year?");
var pcolour = prompt ("What is your favourite colour?");
var somebody = new Person (pName, PAge, Pcolour);
All constructors in JavaScript, as in Java, can be invoked using the New keyword. When a person takes advantage of its attribute {"Patrick",
When "Red"} is created (or constructed), these values can be accessed, such as:
Somebody.name, or
somebody["Name"]
"Patrick"
Somebody.age, or
Somebody["Age"]
22
Somebody.colour, or
Somebody["colour"]
"Red"
Because we use name to increase the properties of the person, they must be referenced by name, as can be seen in the code that follows. If we use numbers, we have to use numbers to refer to them, such as using somebody[0] instead of somebody.name. JavaScript arrays and objects (such as
Forms,images,frames,...) Both of these methods are allowed.
In addition, arrays and objects have an intrinsic property, that is, length. When we compile the program, we can use it this way: Objectname.length, which returns the number of elements or attributes that the object contains.
JavaScript probe Browser Plugin