Bookmarklet Write a detailed guide

Source: Internet
Author: User

A few days ago, I wrote two bookmarklet----"Short URL generation" and "Short URL restore".

They are very convenient to use, besides myself, other friends are using it. The first time to release bookmarklet, you can have users, I am quite satisfied.

The following is my collation of the "Bookmarklet writing guide" for their own and need friends for reference.

One, what is Bookmarklet?

Bookmarklet is a compound word, consisting of a bookmark (bookmark) and a-let (small), which can be translated into a "bookmark tool".

It is in the form of "bookmarks" and is stored in the browser Favorites folder. However, it's not a URL that starts with "http://," but a piece of JavaScript code that starts with "javascript:". After clicking, an action is performed on the current page.

It usually appears as a link in the Web page, as follows:

<a href= "Javascript:alert (' Hi ');" >xxx</a>

Users can simply drag the link to the Address bar or favorite folder.

Second, the advantages of bookmarklet

It has several notable advantages, and other technologies are hard to replace:

1. Fast Installation

Bookmarklet installation, is to save a piece of code in the Favorites folder, one step can be completed. All browsers are natively supported.

2. Easy to use

Use the time, click this link on the line.

3. Easy to develop

A piece of JavaScript code is all the content of the bookmarklet, no need to use other technology, than the development of a browser plug-in is much simpler.

4. Cross-browser

All browsers support Bookmarklet. If written correctly, the same bookmarklet can be used in a variety of browsers.

This column more highlights: http://www.bianceng.cn/webkf/tools/

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.