I have created a variable and tried to set its value by a function. But this value in not accessible outside that function
<script type="text/javascript">
$(document).ready(function () {
var pId;
getProfiles(id,function(b)
{
pId=b;
alert(pId); // It works fine...
});
alert(pId); // undefined...
});
</script>