Success <! DOCTYPE html> <Html xmlns = "http://www.w3.org/1999/xhtml"> <Head> <Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/> <Title> </title> <Script type = "text/javascript"> Var obj = createobj (); Function login (name, pwd) { Var urlstr = "http: /localhost: 14248/server. aspx? Username = "+ name +" & password = "+ pwd; Obj. open ("get", urlstr, true ); Obj. onreadystatechange = dowork; Obj. send (); } Function dowork () { If (obj. readyState = 4) { If (obj. status = 200) { Document. getElementById ("msg"). innerText = obj. responseText; } } } // Create an object Function createobj () { Var xmlHttp = null; Try { // Non-IE browser XmlHttp = new XMLHttpRequest (); } Catch (e) {// IE browser Try { XmlHttp = new ActiveXObject ("Msxml2.HTTP "); } Catch (e) { XmlHttp = new ActiveXObject ("Microsoft. XMLHTTP "); } } Return xmlHttp; } </Script> </Head> <Body> <Table> <Tr> <Td align = "center" colspan = "2"> logon </td> </Tr> <Tr> <Td> User name: </td> <Td> <input type = "text" id = "username" name = "username"/> </td> </Tr> <Tr> <Td> password: </td> <Td> <input type = "password" id = "password" name = "password"/> </td> </Tr> <Tr> <Td> <Input type = "submit" value = "login" onclick = "login (document. getElementById ('username '). value, document. getElementById ('Password '). value) "/> </Td> <Td> <Input type = "reset" value = "clear"/> </Td> <Td> <span id = "msg"> </span> </td> </Tr> </Table> </Body> </Html> |