Dear all,
i am looking for a way to use ajax to receive a value from another php script as a variable. This works perfectly as long as I use the response in a <div>. But I need to use the value in a variable to put it in a dropdown which consists of two variables of the calling script and one I wich to receive from another script. I do it like this at the moment what I guess needs to be rwritten: document.getElementById("partnerHint").innerHTML=xmlHttp.responseText; Hope someone has got an idea
Brgds Pooh12
Ever solved this, i am looking for the exact same thing?
See, it's times like this that it pays to actually understand what it is you're doing instead of just copying stuff you see written elsewhere. To put the response text in a variable called "your_variable", you .... put the response text in a variable:
your_variable = xmlHttp.responseText;
Hi, Pooh12., U can get response text in 'var' javascript and you can manipulate it as however u want to be., using split,match,
var res = xmlHttp.responseText;
Hi together, actually this is the way I use to work: check if somebody else already did a part of the work, understand how it works and suite it for my needsd. But when I opened this thread it was the first time I used ajax calls via JS. But anyways thanx a lot I will try it right away and replace my :-( solution. I will let you know if I was successfull.