I have problem in giving ajax functionality to hyperlink, I have Link.html & GetCustomerdata.php. The main function of HTml is send the data to getCutomerData.php and shows flash as "success".
Ve ayrıca ben köprü ekleyen istemiyorum
<a href="#"
bunun yerine açısından ihtiyaç
<a href=GetCustomer.php?id=<format>
Herkes bu bağlamda bana yardım edin, bu temizlemek mümkün mü?
Link.Html
<html>
<head>
<title>Customer Account Information</title>
<script type="text/javascript">
var url = "GetCustomerData.php?id="; // The server-side script
function handleHttpResponse() {
if (http.readyState == 4) {
if(http.status==200) {
var results=http.responseText;
document.getElementById('divCustomerInfo').innerHTML = results;
}
}
}
function requestCustomerInfo() {
var sId =10;
document.getElementById("txtCustomerId").value;
http.open("GET", url + escape(sId), true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
}
function getHTTPObject() {
var xmlhttp;
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp){
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
}
return xmlhttp;
}
var http = getHTTPObject();
</script>
</head>
<body>
<a href="getCustomerData.php?id=10&onclick="requestCustomerInfo();return false;">Show Me</a>
<div id="divCustomerInfo"></div>
</body>
</html>
... and My php file is just flashes theSuceess Message
getCustomerData.php
<?php
echo "Success"
?>