The ajax function is defined earlier in the file and uses the xmlhttprequest mechanism to call a local php script that will take care of the database update. The call to the ajax function follows the javascript stuff with ajaxFunction('update', var1, var2); where var1 is the key and var2 is the output from the remote javascript call.
Code:
function ajaxFunction(action,var1,var2) {
http.open('get', 'rpc.php?action='+action+'&var1='+var1+'&var2='+var2);
http.onreadystatechange = handleResponse;
http.send(null);
}
I am getting everything to pass correctly to the AJAX function except the previously noted remote javascript call. The remote javascript outputs the following: document.write('32'); - or whatever number...I need that number for var2 of my AJAX function call.
If I'm reinventing the wheel and going about this all wrong, then please tell me what the proper approach is.
Thanks for your feedback! I look forward to hearing more!