﻿{"id":1654,"date":"2019-10-22T09:55:18","date_gmt":"2019-10-22T01:55:18","guid":{"rendered":"http:\/\/jilin.hydesign.tw\/?p=1654"},"modified":"2021-10-23T21:16:06","modified_gmt":"2021-10-23T13:16:06","slug":"html5-browser-detection","status":"publish","type":"post","link":"http:\/\/jilin.hydesign.tw\/index.php\/2019\/10\/22\/html5-browser-detection\/","title":{"rendered":"Html5 Browser Detection \u5224\u65b7\u88dd\u7f6e\u4f86\u6e90"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u5224\u65b7\u88dd\u7f6e\u4f86\u6e90<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">\u5224\u65b7\u624b\u6a5f\u8207\u96fb\u8166<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;script>\n  \/\/\u88dd\u7f6e\u4f86\u6e90\u5224\u65b7\n  if(window.navigator.userAgent.indexOf('iPhone') != '-1' || window.navigator.userAgent.indexOf('Android') != '-1' || window.navigator.userAgent.indexOf('iPad') != '-1')\n {\n   window.location.href='index_mobile.php';\n }\n   else\n {\n   window.location.href='index_desktop.php';\n }\n&lt;\/script><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u5224\u65b7\u624b\u6a5f<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;script>\n   \/\/\u88dd\u7f6e\u4f86\u6e90\u5224\u65b7\n   if(window.navigator.userAgent.indexOf('iPhone') != '-1' || window.navigator.userAgent.indexOf('Android') != '-1' || window.navigator.userAgent.indexOf('iPad') != '-1')\n {\n   window.location.href='index_mobile.php';\n }\n&lt;\/script><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u5224\u65b7\u591a\u500b\u88dd\u7f6e<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var mobiles = new Array\n            (\n                \"midp\", \"j2me\", \"avant\", \"docomo\", \"novarra\", \"palmos\", \"palmsource\",\n                \"240x320\", \"opwv\", \"chtml\", \"pda\", \"windows ce\", \"mmp\/\",\n                \"blackberry\", \"mib\/\", \"symbian\", \"wireless\", \"nokia\", \"hand\", \"mobi\",\n                \"phone\", \"cdm\", \"up.b\", \"audio\", \"sie-\", \"sec-\", \"samsung\", \"htc\",\n                \"mot-\", \"mitsu\", \"sagem\", \"sony\", \"alcatel\", \"lg\", \"eric\", \"vx\",\n                \"NEC\", \"philips\", \"mmm\", \"xx\", \"panasonic\", \"sharp\", \"wap\", \"sch\",\n                \"rover\", \"pocket\", \"benq\", \"java\", \"pt\", \"pg\", \"vox\", \"amoi\",\n                \"bird\", \"compal\", \"kg\", \"voda\", \"sany\", \"kdd\", \"dbt\", \"sendo\",\n                \"sgh\", \"gradi\", \"jb\", \"dddi\", \"moto\", \"iphone\", \"android\",\n                \"iPod\", \"incognito\", \"webmate\", \"dream\", \"cupcake\", \"webos\",\n                \"s8000\", \"bada\", \"googlebot-mobile\"\n            )\n   \n    var ua = navigator.userAgent.toLowerCase();\n    var isMobile = false;\n    for (var i = 0; i &lt; mobiles.length; i++) {\n        if (ua.indexOf(mobiles[i]) > 0) {\n            isMobile = true;\n            \/\/mobile\u7248\u8655\u7f6e\u65b9\u5f0f(ex:\u8f49\u5230m\u76ee\u9304\u4e0b)\n            window.location.href='m\/';\n            break;\n        }\n    }<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5224\u65b7\u88dd\u7f6e\u4f86\u6e90 \u5224\u65b7\u624b\u6a5f\u8207\u96fb\u8166 \u5224\u65b7\u624b\u6a5f \u5224\u65b7\u591a\u500b\u88dd\u7f6e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,12,4],"tags":[],"class_list":["post-1654","post","type-post","status-publish","format-standard","hentry","category-html","category-front-end","category-notes"],"_links":{"self":[{"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/posts\/1654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/comments?post=1654"}],"version-history":[{"count":7,"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/posts\/1654\/revisions"}],"predecessor-version":[{"id":1869,"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/posts\/1654\/revisions\/1869"}],"wp:attachment":[{"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/media?parent=1654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/categories?post=1654"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jilin.hydesign.tw\/index.php\/wp-json\/wp\/v2\/tags?post=1654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}