sas523
یک شنبه 17 خرداد 1388, 18:13 عصر
سلام دوستان من یک مشکلی دارم ، این کد مربوط به ای جکس میشه
ولی چیزه خاصی نداره از قسمت بادیش & اولین تابعم ارور میگیره ممنون میشم کمکم کنید
این متن ِ کدم :
<html>
<head>
<script language="javascript">
var xmlhttp = null;
function createxmlhttprequest()
{
if (window.activexobject){
xmlhttp = new activexobject('microsoft.xmlhttp');
}else{
xmlhttp = new xmlhttprequest();
}
return xmlhttp ;
}
function process ()
{
createxmlhttprequest();
if (xmlhttp != null)
{
var uname = document.getElementByid('uname').value;
xmlhttp.open('GET','welcome.php?name='+ uname , true);
xmlhttp.onreadystatechange = update;
xml.send(null);
}else{
alert ("Your Browser does not support Ajax");
}
}
function update ()
{
if (xmlHttp.readyState == 4 ){
var message = xmlHttp.responseText;
document.getElementByid('mdiv').innerhtml = "welcome " + message ;
}else{
alert("Problem with server");
}
}
</script>
<title>Using Ajax</title>
</head>
<div id="mdiv"></div>
<body>
<input type ="text", id = "unam", onkeyup ="process()" />
</body>
</html>
ولی چیزه خاصی نداره از قسمت بادیش & اولین تابعم ارور میگیره ممنون میشم کمکم کنید
این متن ِ کدم :
<html>
<head>
<script language="javascript">
var xmlhttp = null;
function createxmlhttprequest()
{
if (window.activexobject){
xmlhttp = new activexobject('microsoft.xmlhttp');
}else{
xmlhttp = new xmlhttprequest();
}
return xmlhttp ;
}
function process ()
{
createxmlhttprequest();
if (xmlhttp != null)
{
var uname = document.getElementByid('uname').value;
xmlhttp.open('GET','welcome.php?name='+ uname , true);
xmlhttp.onreadystatechange = update;
xml.send(null);
}else{
alert ("Your Browser does not support Ajax");
}
}
function update ()
{
if (xmlHttp.readyState == 4 ){
var message = xmlHttp.responseText;
document.getElementByid('mdiv').innerhtml = "welcome " + message ;
}else{
alert("Problem with server");
}
}
</script>
<title>Using Ajax</title>
</head>
<div id="mdiv"></div>
<body>
<input type ="text", id = "unam", onkeyup ="process()" />
</body>
</html>