Ali0Boy
چهارشنبه 15 شهریور 1391, 13:29 عصر
سلام دوستان. من از کد زیر برای نمایش یک صفحه ی دیگر به نام "mnropt.php" در صفحه ی جاری، داخی یک دیو به نام "ifshow" استفاده کرده ام. ولی مانده ام که چرا نمایش نمی دهد:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
function chkUser() {
if(window.XMLHttpRequest) {
xmlhttp= new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState ==4 && xmlhttp.status == 200) {
document.getElementById('ifshow').innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open('post', 'http://google.com', true);
xmlhttp.send();
alert("best");
}
function chngpg(index)
{
if(index==1)
{
chkUser();
}
else
{
alert(index);
}
}
</script>
</head>
<body><center>
<a href="" onClick="javascript: chngpg(1);">Go TO</a><br>
<div id="ifshow" style="width:800px; height:700px;border:1px solid #000;"></div></center>
</body>
</html>
خواهشا سریعا جواب بدین. کل پروژه برای همین مشکل خوابیده!!!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
function chkUser() {
if(window.XMLHttpRequest) {
xmlhttp= new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState ==4 && xmlhttp.status == 200) {
document.getElementById('ifshow').innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open('post', 'http://google.com', true);
xmlhttp.send();
alert("best");
}
function chngpg(index)
{
if(index==1)
{
chkUser();
}
else
{
alert(index);
}
}
</script>
</head>
<body><center>
<a href="" onClick="javascript: chngpg(1);">Go TO</a><br>
<div id="ifshow" style="width:800px; height:700px;border:1px solid #000;"></div></center>
</body>
</html>
خواهشا سریعا جواب بدین. کل پروژه برای همین مشکل خوابیده!!!