Is it possible to pass variables into an onReadyStateChange function for and XMLHTTP object?
-
Whenever I try to add variable parameters or even add () to the function it stops working. The code I am talking about is xmlhttp.onreadystatechange = function
-
Answer:
The reason that wouldn't work is because the value you set for xmlhttp.onreadystatechange has to be a function. If you have function() or function(arg1, arg2), it wouldn't work because the value would be the value returned by the execution of the function. Try xmlhttp.onreadystatechange = function (){ function(arg1, arg2);}
Abi Raja at Quora Visit the source
Related Q & A:
- How to pass a parameter to a function that is called on an event?Best solution by Stack Overflow
- Object reference not set to an instance of an object; null?Best solution by Stack Overflow
- How to pass a javascript object back to the server?Best solution by developer.mozilla.org
- How to solve "Object reference not set to an instance of an object?Best solution by Stack Overflow
- How can I pass global variables into a function?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.