Create a blog plug-in for 365rss. cn

Source: Internet
Author: User

Yesterday, I was lucky to win the team version of vs.net 2005. In use, it is much better than the Pro version, and many functions are added. I like it very much. There is nothing to do in the morning. See 365rss. the method used to add "add to" link in the blog before CN is really too troublesome. I studied the following and thought about how to improve it. If you do not need to enter the title and connection, however, it must be nice to add a page directly when it is generated.
Looking at the creation methods of other websites is actually very simple, that is, creating a separate JS file and then adding it. Both the title and URL are obtained using the Document Object of JS, and then the dynamic write link is OK. The following section describesCodeThe source code is always the first one:

Document. Write (' < A href = "
Javascript: U = location. href;
T = Document. title;
C = % 22% 22 + (window. getselection? Window. getselection (): Document. getselection? Document. getselection (): Document. selection. createRange (). Text );
C = C. substr (0,480 );
VaR url = % 22 http://www.365rss.cn/tools_rightClick.aspx? T = % 22 + encodeuricomponent (t) + % 22 & U = % 22 + encodeuricomponent (u) + % 22 & C = % 22 + encodeuricomponent (c) + % 22 & Fr = JS # nw = 1% 22; window. open (URL, \ '_ blank \', \ 'scrollbars = No, width = 600, Height = 450, Left = 75, Top = 20, status = No, resizable = Yes \ '); void 0 " > < IMG border = " 0 " Width = " 116 " Height = " 19 " SRC = " Http://www.365rss.cn/_images/btn_share_small.gif " >
</ A > ');

The code is in one line, and I divide it into multiple lines for reading. How to use this JS? You only need to add the following JS on the page:

< Script SRC = " Http://www.365rss.cn/blog/plugin/add.js " Type = " Text/JavaScript " > </ Script >

check the effect:

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.