Js Telecom China Netcom dual-line automatic selection tips _ javascript skills

Source: Internet
Author: User
The speed of website opening is very important. baidu.com is very fast no matter what network you are using. We don't talk about the initial development of the products, because it doesn't make much sense, if you are a student, the proportion of students using telecommunications and campus networks is basically too variable based on our four-year experience in university.
Fortunately, China Telecom, China Netcom dual-line north Netcom, and China South Telecom have become a feature of our country. Even in the Spring Festival of, the internal agreement between China Telecom and China Netcom was revealed. The content is about the mutual infringement between the North and the South on their respective fields. Therefore, to establish a successful Internet product, you must not care where the user comes from or what network environment the user uses. The final solution is China Telecom and China Netcom. There is also a gap-campus network. The better thing is that the campus network and China Netcom have a wide fiber-optic direct connection, and the physical environment can be solved by using meters.

Technical Processing

The Code is as follows:






This is the core code automatically selected by China Telecom and China Netcom. It's amazing. It's actually implemented by js.

Explanation: There is a nonexistent address in src, so that when two img are opened, errors will occur and the onerror event will be triggered, however, your browser has an order of loading and judging the two img errors. The order depends on the speed of your browser to connect two URLs, this shows the speed of two domain names in an http request. Assume that you are a campus network or China Netcom, and connect www.jb51.net (this domain name is bound to an ip address of China Telecom) and cnc.jb51.net (this domain name is bound to an ip address of China Netcom)

Of course, onerror = "Javascript: top. location = 'HTTP: // cnc.jb51.net'" will be triggered first '"

This opens the http://cnc.jb51.net.

Similarly, China Telecom finally enabled the campus network and China Netcom users to access http://www.jb51.net/drect. the e-credit account is opened at http://www.jb51.net/direct.
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.