I am trying to make a function like this but i need the parameters to be a string .
function viewrestaurant(int)
{
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("boxcenter").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","viewrestaurant.php?viewr="+int,true);
xmlhttp.send();
}
this works find when i use the function i can run it fine but only as an int as seen here
function viewrestaurant(int)
How could i replace int with a string? it doesnt work, nor a var. thanks all for your help.