Accelerator in Internet Explorer 8

Source: Internet
Author: User

Continue to write about antique bars.

Accelerator, the Chinese version is accelerator

It's also a fun thing for IE8.

For development documentation, see msdn

In fact, it is an XML document. Let's first try it out for a book search.

 

Add accelerator:

 

Select text:

 

Select accelerator:

 

Search results (cup, not even related ...) :

 

Let's take a look at the code.

To create an accelerator, you must create an XML file on the server. The Code is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <OS: openservicedescription xmlns: OS = "http://www.microsoft.com/schemas/openservicedescription/1.0"> <OS: homepageurl> http://library.ouc.edu.cn/</OS: homepageurl> <OS: Display> <OS: name> library search </OS: Name> <OS: icon> http://library.ouc.edu.cn/favicon.ico </OS: icon> <OS: Description> library search </OS: description> </OS: Display> <OS: activity category = ""> <OS: activityaction context = "selection"> <OS: Execute action = "H Ttp: // library.ouc.edu.cn/opac/search.aspx? "Method =" get "> <OS: parameter name =" Words "value =" {selection} "type =" text "/> </OS: Execute> </OS: activityaction> </OS: activity> </OS: openservicedescription>

 

Maybe you can see it.

It consists of three parts: homepageurl, display, and activity.

1, homepageurl

This is the home address of the accelerator service. Note that the link to the action in the activity must be in the domain specified by homepageurl, otherwise, an error will be reported when you register the accelerator.

2, display

This node is composed of three parts:

Name: name displayed by the accelerator

Icon: the name of the accelerator displayed in the browser

Discription: Introduction to Accelerators

3. Activity

This is the node for implementing the accelerator function.

Activity: this node sets the function category of the accelerator. IE8 has six categories by default: map blog define add translate share. Of course, you can also write them by yourself.

The default value of the context attribute of the node activityaction is selection, which is to select the reversed data.

Execute is the redirection address, and action is the address (note that it should be in the same domain as homepageurl). method can have get and post methods.

Parameter is the value-passing node. You can see more than one parameter, such as name, value, and type.

The last thing to say is to register the accelerator for the browser. The HTML code:

<Button onclick = "window. External. addservice ('HTTP: // library.ouc.edu.cn/search.xml')"> Add an accelerator </button>

That's all.

More comprehensive descriptions on msdn

For more information, see msdn.

 

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.