I have a function that is passed a variable.
I need to then make the variable global so it is available to another function
How do i get str into the next function as shown in red?
Help much appreciated.
I need to then make the variable global so it is available to another function
Code:
function getspecial([COLOR="Red"]str[/COLOR]) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="index.php/home/getSpecial/" url=url+str xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById([COLOR="Red"]str[/COLOR]).innerHTML=xmlHttp.responseText } }
Help much appreciated.
Comment