A few lines of code easy to deal with the simple transformation of Web pages

Source: Internet
Author: User
Tags add
Simple Multiplication Conversion | Web page to the Web page to simplify the method of font conversion generally have two kinds: one is the use of "Jen Fintong" Such professional software, the other is the production of two versions of the Web page. Obviously, both approaches are cumbersome, and professional software is generally not available for free space. The author here to provide you with a very simple method, only need to add a few lines of code on the page can easily handle the simple Web page conversion.

First in http://www.knowsky.com/download/transform.js Download for the conversion of JS file Transform.js, copied to the Site directory, and then use the Web page production tools to open the need for simple conversion of the page, in the code to add the following code:

<script type= "Text/javascript" language= "JavaScript" src= "Transform.js" ></script>

<script type= "Text/javascript" language= "JavaScript" >

function s2t ()

{document.body.innerhtml = document.body.innerHTML.s2t ();}

function T2s ()

{document.body.innerhtml = Document.body.innerHTML.t2s ();}

</script>

Then add a simple link to the appropriate location of the Web page: <a href= "javascript:s2t ()" > Traditional Chinese </a> <a href= "Javascript:t2s ()" > Simplified Chinese </a >

Save the page, click on the "Traditional Chinese" link, the page will become traditional, click "Simplified Chinese" will automatically convert to simplified form, convenient for different users to browse the choice.

Tip: This method is not only applicable to static Web sites can also be used in forums, message boards and other dynamic Web site systems.

Turn from: Dynamic Network production guide www.knowsky.com

Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.