fix mobile safari alert issues (fix #850)
Fix pull #859
Merge pull request #874 from bootstraponline/859

#859