Jump to content

n this example when i select some thing then it display content on the page but how could i hold those value in a variable


saha19

Recommended Posts

You already have it in xmlhttp.responseText

 

If you want to use it in further scripted processing then just move it to a variable and proceed from there.

Link to comment
Share on other sites

You already have it in xmlhttp.responseText

 

If you want to use it in further scripted processing then just move it to a variable and proceed from there.

globalVariableName = xmlhttp.responseText;

 

someOtherFunction();

 

function someOtherFunction()
{
alert(globalVariableName);
}

 

 

is it like that ,if its then it not working so can u tell me what is the write syntax

Link to comment
Share on other sites

Inside the readystatechange handler, that's where you assign the responseText to a global variable.

 

Remember that it won't be available until after the request has been completed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...