ซึ่งเราสามารถสั่งให้ Browser แสดงผลต่างกันได้ด้วย function ง่ายๆ นี้ครับ
function isiPhone(){
return (
(navigator.platform.indexOf("iPhone") != -1) ||
(navigator.platform.indexOf("iPod") != -1) ||
(navigator.platform.indexOf("iPad") != -1)
);
}
เวลานำไปใช้ก็เช่น
if( isiPhone() ) {
window.alert("You are browing this site by iOS browser");
}
ที่มา: http://jquery-howto.blogspot.com/2010/09/iphone-ipod-detection-using-jquery.html
ไม่มีความคิดเห็น:
แสดงความคิดเห็น