The alert not showing up could be caused by the fact that you are closing the window right after trying to display the alert. Try:
success: function (response) {
var val1 = response.d;
alert(val1);
if (val1 == "1") {
}
},
As for it not working in Safari, I might look at the contentType option, it's possible utf-8 is causing grief.
Also, maybe think about using jQuery's $.post() function instead of $.ajax() directly. $.post() is a wrapper for what you are trying to do with $.ajax() and may have defaults set that work in Safari.