mah.tab
چهارشنبه 25 تیر 1393, 19:16 عصر
من از پایه با استفاده از ایجکس تو yii مشکل دارم، یعنی یه کار ساده مثل تغییر تکست هم نمیتونم انجام بدم،
<script>
function loadXMLDoc()
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>
<div class="container" id="page">
<div id="header">
<div id="logo"><?php echo "<img src=/mySite/images/ax.jpeg>" ; ?></div>
</div><!-- header -->
<!-- AJAX TEST -->
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>
<!-- FIN AJAX -->
میشه یه راهنمایی کلی بکنین
<script>
function loadXMLDoc()
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>
<div class="container" id="page">
<div id="header">
<div id="logo"><?php echo "<img src=/mySite/images/ax.jpeg>" ; ?></div>
</div><!-- header -->
<!-- AJAX TEST -->
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>
<!-- FIN AJAX -->
میشه یه راهنمایی کلی بکنین