--


ascending link values in a document.getElementById

by

 
Hi there,

I was strugling some hours with javascript and Ajax, but did not find a solution.

Think that for you specialist it will be easy and sure you'll about my simple question :)


Starting with Ajax / Javascript / PHP I found an example (code below)
Google advises to make an double navigation so that also non javascript users can navigate and the googlebot can read the pages.

Their (google) example:
<a href=”ajax.htm?foo=32” onClick=”navigate('ajax.html#foo=32'); return false”>foo 32</a>

What I'd like to make is a menu or link navigation (loop build with php).
How can I put the several navigation id's so it works with the document.getElementById("txtCustomerId").value;

Who can help me with this ?

Thanks a lot !
Valeria


----------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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 = 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(); // We create the HTTP Object
</script>
</head>
<body>
<p>Enter customer ID number to retrieve information:</p>
<p>Customer ID: <input type="text" id="txtCustomerId" value="" /></p>
<p><input type="button" value="Get Customer Info" onclick="requestCustomerInfo()" /></p>

</body>
</html>



Posted on Sep 24, 2008, 11:41 AM

Respond to this message

Goto Forum Home

Find more forums on JavaCreate your own forum at Network54
 Copyright © 1999-2008 Network54. All rights reserved.   Terms of Use   Privacy Statement