JavaScript probe Browser Plugin

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.