Click to See Complete Forum and Search --> : xmlHttp.responseText as variable


Pooh12
07-24-2008, 08:52 AM
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

Inpresif
11-29-2008, 07:20 PM
Ever solved this, i am looking for the exact same thing?

Weedpacket
11-30-2008, 04:23 AM
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;

Imagineer
12-04-2008, 01:23 AM
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;

Pooh12
12-04-2008, 04:10 AM
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.