1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "Text/html;charset=utf-8"/>5 <title>TBUSF System</title>6 <Scripttype= "Text/javascript"src= "./html_api.js"></Script>7 8 </Head>9 Ten <Bodystyle= "background-color:gray;padding:20px;"> One A <!--Page Title - - <H1style= "Text-align:center;color:yellow">Welcome to TBUSF System</H1><BR/> - the <!--User Login - - <P1style= "Color:black">User Name:</P1><BR/> - <inputID= "user_id"Tyle= "Text-align:center"type= "text"name= "username"><BR/> - <P1style= "Color:black">Code:</P1><BR/> + <inputID= "code_id"type= "text"name= "Code"> - <BR><BR> + A <!--Click to go to the next page - at <inputstyle= "font-size:15px;"type= "button"onclick= "Jump_page (' user_id ', ' code_id ')"value= "Next page->"> - - </Body> - </HTML>
./html_api.js (click on the function called by login):
1 function Jump_page (id_x,id_y)2 {3 Try4 { 5 X=document.getelementbyid (id_x). value;6 Y=document.getelementbyid (id_y). value;7 if (x = = ' Liu Yang ' && y = = ' 1992 ')8 n =1;9 ElseTen n = 3; One switch (n) A { - Case 1: -window.open (' https://www.baidu.com'); the Break ; - Case 2: -Window.location.href= ' https://www.baidu.com'; - Break + Default: - alert ("fail"); + } A } at catch (Err) - { - txt = err.message - alert (TXT); - } -}
Web Landing Framework Code