\u667a\u7535\u745e\u521b<\/a>= navigator.userAgent.match(\/iphone|ipod|ipad\/gi),<\/p>\n isSafari = isIOS && navigator.userAgent.match(\/safari\/gi),<\/p>\n
osVersion = parseFloat(<\/p>\n
(” + (\/CPU.+OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile\/i.exec(navigator.userAgent) || [0, ”])[1])<\/p>\n
.replace(‘undefined’, ‘3_2’).replace(‘_’, ‘.’).replace(‘_’, ”)<\/p>\n
) || false;<\/p>\n
if (isIOS && isSafari && osVersion && osVersion <\/p>\n
var aLink = document.createElement(‘a’);<\/p>\n
aLink.setAttribute(‘href’, [website link]);<\/p>\n
aLink.setAttribute(‘title’, [website name]);<\/p>\n
aLink.setAttribute(‘rel’, ‘apple-touch-icon’);<\/p>\n
var touchIconLink = [].slice.call(document.head.querySelectorAll(‘link[rel=apple-touch-icon]’)).pop();<\/p>\n
if (touchIconLink) {<\/p>\n
touchIconLink.setAttribute(‘href’, [icon path]);<\/p>\n
} else {<\/p>\n
document.head.appendChild(document.createElement(‘title’)).innerText = [website name] + ‘ Web App icon’;;<\/p>\n
document.head.appendChild(aLink);<\/p>\n
}<\/p>\n
aLink.addEventListener(‘click’, function(e) {<\/p>\n
e.preventDefault();<\/p>\n
window.location.href = [website link];<\/p>\n
}, false);<\/p>\n
}<\/p>\n
“`<\/p>\n
3\uff09\u6700\u540e\u5c06\u7f51\u7ad9\u6dfb\u52a0\u5230\u5c4f\u5e55\u4e3b\u5c4f\u5e55\u5373\u53ef\u3002<\/p>\n
\u603b\u7ed3<\/p>\n
Hybrid App \u4e0e Web App \u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\uff0cHybrid App \u66f4\u597d\u5730\u7ed3\u5408\u4e86 HTML\u3001CSS \u548c JavaScript \u6280\u672f\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u5b9e\u73b0\u539f\u751f\u7684\u7528\u6237\u4f53\u9a8c\uff0c\u4f46\u9700\u8981\u4f7f\u7528 Cordova \u7b49\u5de5\u5177\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5177\u5907\u76f8\u5173\u7684\u7f16\u7a0b\u6280\u80fd\uff0c\u5e76\u4e14\u9700\u8981\u57fa\u4e8e\u539f\u751f\u5e94\u7528\u7f16\u5199\u63d2\u4ef6\u5b9e\u73b0\u7279\u5b9a\u529f\u80fd\u3002\u800c Web App \u7b80\u5355\u6613\u7528\uff0c\u9002\u7528\u4e8e\u5bf9\u6027\u80fd\u8981\u6c42\u4e0d\u9ad8\u7684\u5e94\u7528\uff0c\u4f46\u4e5f\u6709\u4e00\u5b9a\u9650\u5236\u3002\u5f00\u53d1\u8005\u9700\u8981\u5177\u5907 HTML\u3001CSS \u548c<\/p>\n
<\/figure>\n<\/p>\n JavaScript \u7684\u57fa\u7840\uff0c\u540c\u65f6\u9700\u8981\u638c\u63e1\u54cd\u5e94\u5f0f\u8bbe\u8ba1\u548c\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u77e5\u8bc6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u8981\u5c06\u4e00\u4e2a\u7f51\u9875\u53d8\u6210\u4e00\u4e2aAPP\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u548c\u6280\u672f\uff0c\u4f7f\u5f97\u7f51\u9875\u53ef\u4ee5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u4ee5APP\u7684\u5f62\u5f0f\u8fd0\u884c\u3002\u4e0b\u9762\u6211\u5c06\u4e3a\u4f60\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5\uff1aHybrid App\u548cWeb App\u30021. Hybrid AppHybr<\/p>\n","protected":false},"author":23,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5308,27333,56,849,414],"topic":[],"class_list":["post-30319","post","type-post","status-publish","format-standard","hentry","category-kaifaapp","tag-html-app","tag-vueapp","tag-56","tag-849","tag-414"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/30319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=30319"}],"version-history":[{"count":1,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/30319\/revisions"}],"predecessor-version":[{"id":30351,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/30319\/revisions\/30351"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=30319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=30319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=30319"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=30319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}