In my page I get user fb_id in one of function function1() when user perform login action.
Later when user click on some button another function call takes place which calls function2(). I want to fetch value of fb_id in function2().
How can i do it?
structure is like below:
<html>
<head>
<script>
function fuction2()
{
// some process
var id = fb_it; // Getting fb_it from function1()
}
</script>
</head>
<body>
<script>
function function1()
{
var fb_it='xyz';
}
</script>
<button type="submit" onclick="function2()"> GetID </button>
</body>
Is it possible or not? If yes then how?
int fb_it='xyz';. Use thevarkeyword.