Click here to Skip to main content
15,881,839 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
HTML
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Pootle Login Girişi</title>    
    <meta content="text/html; charset=utf-8" http-equiv="content-type" />
		<script type="text/javascript">
		function login()
		{
			var xhr;
			if (window.XMLHttpRequest) {
				//Firefox, Opera, IE7, and other browsers will use the native object
				xhr = new XMLHttpRequest();
			}else{
				//IE 5 and 6 will use the ActiveX control
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
			if(document.getElementById("username").value == "" || document.getElementById("password").value == "" )
				{
					alert('kullanıcı adı ve parolayı giriniz');
					return false;
				}
                        

			xhr.onreadystatechange=function()
			{
				if (xhr.readyState==4 && xhr.status == 200){
					alert('Giriş Yapıldı...');
					document.getElementById("console").innerHTML = xhr.responseText;
				}
				else{
					alert('hatalı giriş');
					document.getElementById("console").innerHTML = xhr.responseText;
				}
			}
			xhr.open("GET", "http://api.ozdincer.com:8000/api/v1/", false, document.getElementById("username").value, document.getElementById("password").value);
			xhr.send("");
			}
	</script>
</head>
<body>
<form id="login" onsubmit="return login()">
			kullanıcı adı: <input id="username" value="" /><br />
			parola:        <input type="password" value="" id="password" /><br />
			<input type="submit" value="Giriş yap" />
		</form>
		<span id="console"></span>
Posted
Updated 30-Oct-14 9:11am
v2
Comments
Sergey Alexandrovich Kryukov 30-Oct-14 15:11pm    
Sorry, "not working" is not informative. You need to explain the problem is detail.
I formatted your code sample with "pre" element; please use "Improve question" to see how it's done; add your problems description.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900