shane18 Posted February 11, 2010 Share Posted February 11, 2010 I need to use data from a Array called WR... in a function used in the Ajax onreadystatechange.... In PHP I know you do.. gobal $WR; whats the way for javascript? Link to comment https://forums.phpfreaks.com/topic/191719-javascript-function/ Share on other sites More sharing options...
RussellReal Posted February 11, 2010 Share Posted February 11, 2010 just use it.. in Javascript there are only 2 scopes.. function variables and global variables, anything specified outside of a function will be available inside of a function.. everything specified inside of a function will be destroyed after the function exits. Link to comment https://forums.phpfreaks.com/topic/191719-javascript-function/#findComment-1010523 Share on other sites More sharing options...
shane18 Posted February 11, 2010 Author Share Posted February 11, 2010 yea i figured out why it wouldn't work, thanks for that info though Link to comment https://forums.phpfreaks.com/topic/191719-javascript-function/#findComment-1010524 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.