HTML section
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "> <HTMLxmlns= "http://www.w3.org/1999/xhtml"> <Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/> <title>JS Web page Traditional simplified conversion</title> <Scriptlanguage= ' JavaScript 'src= ' Lang.js '></Script> </Head> <Body> <ahref= "Javascript:zh_tran (' s ');"class= "Zh_click"ID= "zh_click_s">Simplified</a> <ahref= "Javascript:zh_tran (' t ');"class= "Zh_click"ID= "zh_click_t">Traditional</a> <BR><BR> </Body> </HTML>
JS section
//Web simplified Traditional conversion//This JS is used for customers to choose Traditional Chinese or Simplified Chinese display in the website page, the default is normal display, that is, simple and traditional display//when a user first accesses a webpage, the client language is automatically detected and prompted. This feature can be turned off//This program is only tested under UTF8 encoding and does not guarantee that other codes are valid. //--------------Most of the following parameters can be changed--------------------//s = Simplified Simplified Chinese t = traditional Traditional Chinese n = normal displayvarZh_default = ' n ';//default language, please do not changevarZh_choose = ' n ';//Current SelectionvarZh_expires = 7;//Cookie Expiration DaysvarZh_class = ' Zh_click ';//the class name of the link, one of class + s/t/n IDvarzh_style_active = ' font-weight:bold; Color:green; ';//the currently selected link stylevarzh_style_inactive = ' color:blue; ';//a link style that is not currently selectedvarZh_browserlang = ";//Browser Languagevarzh_autolang_t =true;//automatic operation when the browser language is traditionalvarzh_autolang_s =false;//The browser language is automatically manipulated when simplifiedvarZh_autolang_alert =true;//whether to display a prompt message after automatic operation//prompt message after auto-operationvarZh_autolang_msg = ' Welcome to this site, this site for the convenience of Taiwan, Hong Kong's user \n1. Use the UTF-8 International Code and use any language to post without a password. \n2. Auto-judge the user, showing the Web \n3. At the top of the page is a language choice, If you have a problem, you can switch to \N4. This message is only displayed once in the cookie's validity period '; varzh_autolang_checked = 0;//The number of times to detect the browser, the first write a cookie is 1, after the hint is 2, will no longer prompt //determine the browser language's regular, IE is lowercase, ff is uppercasevarzh_langreg_t =/^zh-tw|zh-hk$/i; varzh_langreg_s =/^zh-cn$/i; //simplified traditional Control word table, can be replaced by itselfvar zh_s = ' Ai ai in love AO-ao-ba-yu-tie-off to do the trip tied the pound slander to peel a full Bao Pao bei Jackal prepare exhausted stretch pen close side make up and turn off the edge of the soft-shelled turtle flat off bin bin cake dial pot platinum barge BU Ginseng silkworm remnant ashamed miserable cabin cang Cang toilet side of the test layer astonished mixed with cicada, Chan-chan wrapped shovel production chatter field taste long repayment bowel Factory Chang Note car dust Chen lining support said punish Cheng-late chi shame teeth blazing insect pet domain lift Catinaccio raise silk ugly cupboard kitchen hoe young bases storage contact sore Chong Hammer pure words to give Cong chimneys from the clump of the wrong up with the Tan Shan gall shishi Christmas bomb when the party swing the Island Prayer guide Thief Light Deng Enemy polyester recursive point Mat electric lake fishing to overlap nail top ingot Set East moving building frozen bucket calf single-read bet plating forged broken satin team to the ton of blunt snatch goose forehead false hungry son bait II send a penalty valve alum vanadium annoying fan food visit spinning FEI waste fee dispute Fen Zhi Feng Feng feng qi qi feng sewing irony Phoenix Skin spoke Fu Fu complex negative Obituary the calcium Gaigan to drive the stem Gan Gang gang steel hillock Gao Hao shelf pigeon ge chromium to Shing Gong hook ditch to buy enough tricky Gu Guan Guan Hall customs wide regulation silicon to turtle and the Ark of your executioner roll pot country over terrible Han Hanyu crane he transverse bang hung red after the pot of Hu Hu hua painting strokes words Huai Huan ring also slow change call body Huan Huan yellow lie wave destroy bribe will stew hui taboo to paint meat and chicken get goods disaster hit machine accumulate hunger ridiculed chickens performance of the grade squeeze a few thistle Ji Ji kee Jia potassium price driving in the prison of the Jiang of the difficult sealed cocoon inspection alkali pick pick up the base see key ship sword preserves gradually splash jian pulp Jiang Paddle award the sauce glue pouring arrogance jiao stir hinge straightening after blast foot dumplings pay more the stalk of the straw and the neck by the static mirror diameter of the old colt of the saw fear play Juan Silk Jie Jie Wei Wei-Jin Jin-June only to enter the Jincheng all the way to the king of the Army Chun-kai Shell lesson Ken to pull the bank pants Kua Block executioner Wide mining conditions deficit kui peep feed collapse widening wax La Lai lai blue bar stop Lan calumniate lazy cable Rotten Fishing Lao music Lei Lei lei the Lei Li Li 厉励砾 calendar lek two Lian Lian even sickle-pity ripple curtain convergence face chain love practice grain cool two of the handcuffs of the game near the scale of Rin rental age Bell Linglingling lead Liu Long deaf throat Cage Ridge long Lou Lou hug Basket lu Lu Skull LU Furnace captive to the Ruthero Lu Lou Lu, Lu-Lin, Liu Yin Filter green. The Twins Luanhe Lun Lun to the LUN in the Luo luo luo ma ma code ma horse scold? Buy wheat sell mai pulse deceive steamed bread pretty full them cat anchor riveting trade mold no magnesium door stuffy manganese dream puzzle find cotton Burma temple to kill Min Ming Ming the Mu na na nano difficult to scratch the brain annoyed hungry tired of twisting stuffed bird Nie nickel lime Caracal ning Twist Nim button new pus malaria Ouchi fight vomit retting disk Pang Love compensate spray peng cheat floating frequency Poor apple on the spread of the spreading spectrum of the line of the navel Qi ride The air abandon the hand to pull the lead to move to sign the money clamp latent shallow ditch gun choke wall Qiang strong grab shovel bridge Joe to steal Chin Pro light hydrogen pour is please qing June poor trend area body drive caries zygomatic right advised but magpie let annoying around hot tough recognize thre Rong soft sharp leap run SA Gill race umbrella bereavement sweep astringent kill yarn screen flash Shaanxi allowance burn Shaoxing Credit of the Shen trial of the kidney infiltration sound rope sheng Master Lion wet poem Corpse time Eclipse knowledge driving potential release decoration view trial Life Beast armature transmission book Redemption Tree Vertical number handsome double who tax shun said Shuo Shuo Silk feed shrugged Somo Su although sui old sun damage shoot shrinking lock Rex tart lift spread greed paralysis beach altar tan talk sigh soup hot tao sash copy antimony question body Drawer Iron Hall Listen hydrocarbon copper Head map coating the group decadent shed Camel's oval sock Bend Bay Stubborn Wan Wei Wai Wei Wei-Wai Pseudo-wei Wei Wen smell grain stability asked urn Laos volute vortex hole framed Wu Wan fog false tin sacrifice attack learning milling drama Shrimp Jurisdiction Gorge Narrow xia Shovel fresh fiber Xian Xian Yin title Xianxian filling envy of the constitution of the line trunk town detailed rangXiang sell Xiao Sao Scorpion association carrying threatening harmonic write Xie zinc Peacemaker hing feign rust embroidery Xu Xu Yu continued Xuan selected ringworm gorgeous learn to seek training the pressure Crow duck dumb ya surprised to smoke salt Yan Yan yan yan Yen Duck yang itch a sample of Yao Yang Yao Yao yao yi yi ming zhi ye ye yin The medicine of the leaf medical iridium-like-a-fu-yin-fu Yi-yi to translate different Yi Yam Yin silver drink Sakura Baby Eagle Ching-ying Fly Ying yo-fu Carbuncle Chant Yong Chung gifted worry postal uranium still travel To lure the fish and Yu Yu and the Lantau language calls the Royal prison reputation pre-yu Yuan Yuan shafts Park staff round edge is willing to the key Yue Yue Guangdong Yue Read Cloud Yunyang evenly meteorite Yun Yun Wine together Ltd Halo Rhyme Miscellaneous Disaster load Save temporary praise Dirty chisel jujube stove responsible Choice ze thief gift guillotine brake cheat on the debt felt the hammer precipitous peak stack war split Zhang rise account swelling Zhao switch GE this zhen needle reconnaissance town array earn open by frame Zheng Certificate Weaving Professional paper The quality Bell end kind of the shaft wrinkle Day sudden pig all the candle visions will be stored cast In the brick-to-win pile zhuang makeup big cone pendant zhun mang turbidity of the total longitudinal 邹诅 Group drilling Zhong for only the fierce quasi-kai plate Gimli more chain vent '; var zh_t = ' Backup 藹 failover Fusuma Dams Strikes defeat proceed awards office Bond help kidnapped pound 謗: 'd saturated baby bob my life Bay diacetate stumble prepare tired tightness pen shot close up descended change argued flowers 鼈 message endangered waterfront 擯 cookies flick mortar platinum Mahaina carrot supplement a cruel ashamed dire hotel sunroute Hitomi Hatch Kurashiki 滄州市 WC surprised guarantees blended cicadas 饞 讒 tangles Work Spade factory makes trembling station compensated gut plants few laps money train dust Chen lined appropiate-cheng battlefield going crazy chee Insect Pet categories waver organising silky ugly closet cook She 菢雛之窩 Basics Storage Piles Broke creative weights Pure Dolcevita resignation words grant smart onions chimneys from jungle Minatomachi River break wrong belt loaned the 邯鄲市 Shan bold dreaded the retainer party 蕩 pounding island Prayer pirate light Tang enemy washing parties point mattress power starch fishing adjust mole overlay nail top Spindles subscribe East Nicholas Frozen bullpup plated steel forgings satin confirmed team to ton dull capture swan blackmail evil hungry son lures Daini punishment valve 琺 礬 bangtong trouble Sellers Hotel visit Marl Sleepsac Colorful Cemetery Feng fan anger Dung Maple Feng Feng Sewing The talent of the ironic in the irradiating Obituaries Bondage The calcium-statue-the-efficiency----------synopsis mound, Gao Pickaxes stranded, pigeons, chromium, 龔, strengthening care propaganda, 剮 consistent turtle, bedroom-in-the-rail tricks, cabinet, 劊, nip pot, hackers Korea barriers the bomber hung pot s wooh hua painting, the destruction of the environment is also the paralyzed Longoza 渙 yellow lie, destroy bribery out will ragout the conceal depiction draw utilization awful partner accidents Attack Hunger CANopen Chicken Grade Warrant Extreme class, the crowded Economy Record folder pod cheeks Steve Potassium price destroyers monitoring stick 箋 grueling bite cocoon check alkali alkaline chosen pick simple thrifty threshold draw practices cheap See key battleship 餞 Splash as Syrup jing Paddle Awards sauce watering proud club cubic stirring hinge bulb pacifier amongst foot dumplings Hkgalbert winch sedan more chaff penis amazed décolleté the reduces of the correcting manger the old capsule Inn according to saw Azalea, silk, the commandments, and only Academy KAN to Kuching Ashes unmotivated The Negundo, sincerity, the nick, Tsun Shell kenting. Wide Mineral Kuang Thanks 巋 glimpse feedback bulb Width wax Roast the linked fields suspend appendicitis Guanlan 淀粉质 recruited lazy accord rotten labor abuses music beam anotherjob tears 澇 leave softball gift fences calendar delivering Hanja Lian lian asphalt poor synchronicity scythe ripples facial chain. Lovers Alchemy Dept Cool two forgive Liao 鐐 hunting neighbor Scales Luv rentals Age Ling Davis Pok leader distillation Lau Dragon deaf throat cage monopolistic alongside 隴 floor bellow held 簍 Aloe rupee cranial bailu stove captured 鹵 captive bribery Pauline Donkey lui che Woo aluminum Partners 孿 pedestrians stall, rurunrun boundary lun, turnip logically gong 籮 騾 camel, Mom, 螞蟻, scoid, Michael, cheat 饅 somewhat, 謾 cat anchors riveting, magnesium, boring Mangan dream mystery Praya foraging sponge Sacramento Shrine Extinction Mercy Hokkien resonance motto absurdity conspiracy acre sodium harass brain worries stop! Discouraged blockages scumbags twist stuffed birds nien notable ã isotopes lemon 獰 ning screwed dirt button newport abscesses concentration malarial Boliviano seagulls punch vomit 漚 tray Bond love sue spray pang cheat fluttering video poorer Apple procured review spill undesired poker frontage rustic belly 訖 towed 扡 brazing pencil climate autograph 謙賢 money fangs potential shallow condemnatory 竹塹社 gun back wall at Hog Haft Bridge Joe Beyo dead Tricks theft kitchener gentle hydrogen hectares please celebrate qiong poor trend Torso 齲 zygomatic the right advise Choquette let spare disturb the firmware sewing Glory velveteen sharp rinjita sprinkled gills umbrella harassment sweep shibuya kill yarn Screening herbs blink Shaanxi 贍 Renovation Damage Appreciation tick deterrent JP jury aunts kidney infiltration offenders The Master lion wet the corpse eclipses the reality of the trial Centrum the atonement of the art tree Erector Spinae handsome double who tax said Masters flashing fan dietary towering 慫 Kwan litigation chant administration Sue Hanzi Although Tuy hoa years Sampathkumar damage shoot tedious lock otter à Eben booth greedy emotionally beach altar tan talk Marvel soup boiling wentao 縧 totem ESO diantimony topic drawer The alkanes coating Group 頹 transformation Ostrich Sendagaya Camels elliptical orbits Miyakubo Sock Bend Wan Naughty all over the Nanhuan endeavor the great difference the Wen Wen texture stability asked urn Laos 蝸 swirl nest oooo Tungsten Ugandan 誣 no above Wu Hollywood cloudy mission Siena sacrifices attack edged gameplay krill Jurisdictions Canyon Batman narrowness 鍁 Yin Titles casual show County Pies Envy Constitution line compartments set hometownItems SIU Hyo Tsunami Account Agreement gimps carrying threats harmony write 瀉肚 Thank zinc provocative happy choppy rusty embroidery virtual Shh! To continue Xuan sowing Select Archive Florid School medal search tame train Raven, duck mute, oxen liben smoke, Canary Yangmingshan, Kōmura Proverbs Sun Itch Nourishing Qianyao Emmanuel Kiln Rumors medicine grandfather page Industry doctor Iridium detected heritage 彜 ants art memory hatsumode the meaning of become shade Sakura Baby Eagle 纓 leytoneric The camp fluorescence flies stand yo embrace maid 癰 participative wing flood worries email Lure discussion fishing entertainment and the island calls the prison honor Merquise 鴛 Mabuchi 轅 Park members Circle of the keys Rokkei Cantonese Joy Cloud 鄖 uniform scientist The pendant eradicated Dizzy Wan Leng miscellaneous disaster 攢 The hostage of the dirty è-ovens responsibility, thief giveaway put down byronin gin  shutter Scams fasting debt felt beacon Tad could brand combat Rainbow Love Zhang Coleman account mega Hyperinflationary Zhao 驚蟄 deal germanium This Jung Needle diagnostic array struggling opened 猙 frame 鄭 certification paper sincere sidearm of flags quality Chung finally swelling congregation scholarly axis wrinkled daylight pork 誅 Candles Cinder Testament lagoon cast buildings Consulate in brick stake costume makeup Erlenmeyer flask baggage falling able IPMI conjugation the marinade track CI Mr. Zou cursed Group Diamond so killer the boss Perak the vent '. '; String.prototype.tran=function() { vars1,s2; if(Zh_choose = = ' t ') {S1=zh_s; S2=zh_t; }Else if(Zh_choose = = ' s ')) {S1=zh_t; S2=zh_s; }Else { return This; } varA = ' '; varL = This. Length; for(vari=0;i< This. length;i++){ varc = This. charAt (i); varp =S1.indexof (c) a+ = P < 0?C:s2.charat (P); } returnA; } functionSetcookie (name, value) {varargv =setcookie.arguments; varARGC =setCookie.arguments.length; varexpires = (argc > 2)? ARGV[2]:NULL; if(Expires! =NULL) { varLargeexpdate =NewDate (); Largeexpdate.settime (Largeexpdate.gettime ()+ (expires*1000*3600*24)); } document.cookie= name + "=" + Escape (value) + ((expires = =NULL) ? "" : ("; Expires= "+largeexpdate.togmtstring ())); } functionGetCookie (Name) {varSearch = Name + "="if(Document.cookie.length > 0) {offset=document.cookie.indexOf (search); if(Offset! =-1) {offset+=search.length; End= Document.cookie.indexOf (";", offset); if(end = =-1) end =document.cookie.length; returnunescape (document.cookie.substring (offset, end)); }Else { return‘‘; } } } functionzh_tranbody (obj) {varo = (typeof(obj) = = "Object")?Obj.childNodes:document.body.childNodes; for(vari = 0; i < o.length; i++) { varc =O.item (i); if(' | | br|hr| textarea| Script| '. IndexOf ("|" +c.tagname+ "|") > 0)Continue; if(C.classname = =Zh_class) { if(C.id = = Zh_class + ' _ ' +zh_choose) {C.setattribute (' Style ', zh_style_active); C.style.csstext=zh_style_active; }Else{C.setattribute (' Style ', zh_style_inactive); C.style.csstext=zh_style_inactive; } Continue; } if(C.title! = "&& c.title! =NULL) C.title =C.title.tran (); if(C.alt! = "&& C.alt! =NULL) C.alt =C.alt.tran (); if(C.tagname = = "INPUT" && c.value! = "' && c.type! = ' text ' && c.type! = ' hidden ' && c.type ! = ' password ') C.value =C.value.tran (); if(C.nodetype = = 3) {C.data=C.data.tran (); }Else{zh_tranbody (c); } } } functionZh_tran (GO) {if(go) Zh_choose =go; Setcookie (' Zh_choose ', Zh_choose, zh_expires); if(Go = = ' n ')) {window.location.reload (); }Else{zh_tranbody (); } } functionZh_getlang () {if(GetCookie (' Zh_choose ') ) {Zh_choose= GetCookie (' Zh_choose '); return true; } if(!zh_autolang_t &&!zh_autolang_s)return false; if(GetCookie (' zh_autolang_checked '))return false; if(navigator.language) {Zh_browserlang=Navigator.language; }Else if(navigator.browserlanguage) {Zh_browserlang=Navigator.browserlanguage; } if(zh_autolang_t &&zh_langreg_t.test (Zh_browserlang)) {Zh_choose= ' t '; }Else if(zh_autolang_s &&zh_langreg_s.test (Zh_browserlang)) {Zh_choose= ' s '; } zh_autolang_checked= 1; Setcookie (' Zh_choose ', Zh_choose, zh_expires); if(Zh_choose = = Zh_default)return false; return true; } functionZh_init () {Zh_getlang (); C= document.getElementById (Zh_class + ' _ ' +zh_choose); if(Zh_choose! =Zh_default) { if(window.onload) {Window.onload_before_zh_init=window.onload; Window.onload=function() {Zh_tran (zh_choose); if(GetCookie (' Zh_autolang_check ') {alert (zh_autolang_msg);}; Window.onload_before_zh_init (); }; }Else{window.onload=function() {Zh_tran (zh_choose); if(GetCookie (' Zh_autolang_check ') {alert (zh_autolang_msg);}; }; }}} zh_init ();
Website traditional simplified interchange via JS