I would like to get the var username, and use it in:
I just need to find a way to append the var username from thee function loginMe(), to user_url, so that I can retrieve data from mysql.
I would like to get the var username, and use it in:
I just need to find a way to append the var username from thee function loginMe(), to user_url, so that I can retrieve data from mysql.
There are no way to get variable value from one function to another unless you pass it by parameter or set it as global variable.
When executing loginMe(). You can pass value by calling getUserInfo( username ). Or when you are executing loginMe() you can set username in localStorage and get it in getUserInfo() function from localStorage. Or You can set the value as global variable by window.username then you will be able to access it.