 |
Ajax Send Data Method GET (PHP & ASP) do not work.. ครับ แต่ทำไมมันไม่ยอมทำงาน โดยจะขึ้น "Now loading..." |
|
 |
|
|
 |
 |
|
ไม่รู้จะแนะนำยังงัยเหมือนกัน เพราะ ผมลองโหลดมาทดสอบดู ก้ทำงานปรกติดี ทั้ง ie8 และ chrome
รอท่านอื่นมาเพิ่มเติม ครับ อย่าพึ่งท้อครับ 
|
 |
 |
 |
 |
Date :
2009-05-04 13:47:27 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง debug ดูใน firefox ว่า error ขึ้นว่าอะไรครับ
|
 |
 |
 |
 |
Date :
2009-05-04 15:45:52 |
By :
Silliconvalley |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับทุกท่าน
ผมใช้ IE 8 ครับ และเท่าที่ลองทำดูหลาย ๆ souce code ที่มีการ post ค่าแบบนี้มันจะไม่ทำงาน
|
 |
 |
 |
 |
Date :
2009-05-04 16:50:51 |
By :
Backer |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ compatibility mode ซิครับ เหอะๆ ง่ายดีไหมวิธีนี้ 
|
 |
 |
 |
 |
Date :
2009-05-04 17:38:59 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เรียน คุณปลากริม
น่าจะเดาชื่อถูกนะ พยายามหาตั้งแต่เมื่อวานนะว่า compatibility mode อยู่ตรงไหน ถ้าแวะมากรุณาแนะนำด้วยว่าต้องทำตรงไหน..
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2009-05-05 07:50:45 |
By :
Backer |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เรียน คุณปลากริม...
ถ้าหมายถึง Compatibility View Setting ผมได้ Set ให้เป็น Display All websites Compatibility View แล้ว
|
 |
 |
 |
 |
Date :
2009-05-05 08:05:50 |
By :
Backer |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สงสัยผมคงต้องพักซักแป๊ปนะครับ เพราะขนาดผม copy จาก w3xchools.com ยังไม่ทำงานเลยครับ
|
 |
 |
 |
 |
Date :
2009-05-05 12:30:34 |
By :
Backer |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าไม่มีการแก้ไขโค๊ดเลยนี่ก็น่าแปลกนะ น่าจะใช้งานได้ ขอดูโค๊ดที่รันได้ไหม
|
 |
 |
 |
 |
Date :
2009-05-05 15:13:46 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง debug ดูใน firefox ว่า error ขึ้นว่าอะไรครับ
debug ไงอ่ะ บอกหน่อยดิ
|
 |
 |
 |
 |
Date :
2009-05-05 17:21:32 |
By :
kanowan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Attn Plakri
จริง ๆ แล้วผมดูที่ W3Schools ด้วยนะ และก็พยายามแกะว่ามัน Error ตรงไหน แต่ก็ยังไม่ได้อยู่ดีเลยยิ่งงงใหญ่เลย Code ง่าย ๆ ตามที่ Copy ข้างล่างนี้นะครับ..และผมก็ต้องการอย่างยิ่งว่าให้มัน Error ว่า Your browser does not support ...แต่มันก็ไม่มี
แนะนำด้วยครับ...
Best Regards,
Backer
testAjax.htm
------------------------------------------------------
<html>
<head>
<script src="clienthint.js"></script>
</head>
<body>
<form>
First Name: <input type="text" id="txt1" onkeyup="showHint(this.value)" />
</form>
<p>Suggestions: <span id="txtHint"></span></p>
</body>
</html>
---------------------------------------------
clienthint.js
---------------------------------------------
var xmlhttp
function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML="";
return;
}
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
var url="gethint.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
--------------------------------------------------------------------------
gethint.php
--------------------------------------------------------------------------
<?php
header("Cache-Control: no-cache, must-revalidate");
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Fill up array with names
$a[]="Anna";
$a[]="Brittany";
$a[]="Cinderella";
$a[]="Diana";
$a[]="Eva";
$a[]="Fiona";
$a[]="Gunda";
$a[]="Hege";
$a[]="Inga";
$a[]="Johanna";
$a[]="Kitty";
$a[]="Linda";
$a[]="Nina";
$a[]="Ophelia";
$a[]="Petunia";
$a[]="Amanda";
$a[]="Raquel";
$a[]="Cindy";
$a[]="Doris";
$a[]="Eve";
$a[]="Evita";
$a[]="Sunniva";
$a[]="Tove";
$a[]="Unni";
$a[]="Violet";
$a[]="Liza";
$a[]="Elizabeth";
$a[]="Ellen";
$a[]="Wenche";
$a[]="Vicky";
//get the q parameter from URL
$q=$_GET["q"];
//lookup all hints from array if length of q>0
if (strlen($q) > 0)
{
$hint="";
for($i=0; $i<count($a); $i++)
{
if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))
{
if ($hint=="")
{
$hint=$a[$i];
}
else
{
$hint=$hint." , ".$a[$i];
}
}
}
}
// Set output to "no suggestion" if no hint were found
// or to the correct values
if ($hint == "")
{
$response="no suggestion";
}
else
{
$response=$hint;
}
//output the response
echo $response;
?>
-------------------------
|
 |
 |
 |
 |
Date :
2009-05-11 08:00:29 |
By :
Backer |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|