You need get email explicitly as follows:
var url="/me?fields=name,email";
FB.api(url, function (response) {
alert(response.name);
alert(response.email);
});
And to get the email address, email permission is needed. So the code might look like (there are other options like Register button, login button..)
FB.login(function (response) {
if (response.session) {
var url="/me?fields=name,email";
FB.api(url, function (response) {
alert(response.name);
alert(response.email);
});
}
else {
alert("User did not login successfully");
}
}, { scope: 'email' }); /* perms changed to scope */