Hello everybody i really hope someone here could help me out.
This is kind of ajax/php question but it’s all up-to simple js value now.
I have this piece of code (for ajax rating):
[code]
var url=”rate.php”
url=url+”?q=”+str
url=url+”&id=”+id+”&sid=”+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open(“GET”,url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState==”complete”)
{
document.getElementByid(“txtReload”).innerHTML=xmlHttp.responseText;
}
}
Usualy works like a charm but, now i need to change it a bit.So the thing that i need to change is the value inside (“txtReload”) so it could become txtReload1
where 1 is the value passed through the url (get=id)
Why would i need that?Well i have several element and i need to be reloaded the one which i press the button,and now when i click any of the buttons i reload only the first div with id txtReload.
I tried a lot with (“txtReload”+”+id+”) or (“txtReload”+id+)
and many more , but i just don’t know the right syntax and if he +id+ is the right value (since it should get it from url)