当前位置:网站首页>Mobile applications introduce static Cordova according to different platforms
Mobile applications introduce static Cordova according to different platforms
2022-06-21 09:15:00 【Tie Hanhan plus】
stay index.html The page introduces the following script( Android and ios Of cordova You need to download it yourself and put it in the corresponding path )
<script>
// ------- Inject cordova, Auto fit androway ios platform
(function () {
const agent = navigator.userAgent.toLowerCase();
console.log(agent);
let importForCordova;
if (agent.includes("android")) {
// If you change the deployment path , It needs to be modified here
console.log('android');
importForCordova = "static/android.cordova.min.js";
} else if (agent.includes("iphone") || agent.includes("ipad")) {
// If you change the deployment path , It needs to be modified here
console.log('iphone');
importForCordova = "static/ios.cordova.min.js";
} else {
console.log("Inject Error,Not android nor iOS.")
return;
}
const cordovaScriptElement = document.createElement('script');
cordovaScriptElement.setAttribute('type', 'text/javascript');
cordovaScriptElement.setAttribute('src', importForCordova);
const head = document.getElementsByTagName('head')[0];
head.appendChild(cordovaScriptElement);
})();
// ------ Inject cordova, Auto fit androway ios platform
</script>
边栏推荐
- The difference between tuples and lists
- Tidb and MySQL modify system variables / common statements (kill the process in process)
- STL tutorial 3- type conversion static_ cast、dynamic_ cast、const_ cast、reinterpret_ Cast method
- The internal structure of MySQL and how an SQL statement is executed
- TiDB、mysql修改系统变量/常用语句(杀死process中的进程)
- An app developed based on retrotfit2.1+material design+ijkplayer
- The spring recruitment is also terrible. Ali asked at the beginning of the interview: how to design a high concurrency system? I just split
- finally block can not complete normally
- 【MGT】代码解读之model-MGT
- Talking about Festinger effect
猜你喜欢

STL教程3-类型转换static_cast、dynamic_cast、const_cast、reinterpret_cast方法

Pingcap was selected as the "voice of customers" of Gartner cloud database in 2022, and won the highest score of "outstanding performer"

TiDB3.0- 4.0 内存控制/修改日志保存天数/最大索引长度

How to connect the Internet - FTTH
![[practice] stm32mp157 development tutorial FreeRTOS system 3: FreeRTOS counting semaphore](/img/b1/e4b944877fecc079a772b81c55bfc8.jpg)
[practice] stm32mp157 development tutorial FreeRTOS system 3: FreeRTOS counting semaphore

The difference between tuples and lists

The skill of using ADB and the principle of USB communication

Character function and string function

Alibaba P6 employees came to a small company for an interview and asked for an annual salary increase of 500000 yuan. How dare you speak

智能制造的下一站:云原生+边缘计算双轮驱动
随机推荐
sql查看数据库/表磁盘占用情况,杀死进程终止tidb中的连接
The R language uses the fix function to modify the name of the data variable through the editor. For example, use the fix function to modify the name of the dataframe data column
【C】 [time operation] time operation in C language
STL教程3-类型转换static_cast、dynamic_cast、const_cast、reinterpret_cast方法
【JUC系列】Executor框架之CompletionService
STL tutorial 2-myarray framework implementation
Retrofit擴展閱讀
R language sets na Rm=true parameter, deleting missing values in calculation and analysis to obtain valid calculation results (excluding missing values from analyses)
leetcode:打印两个有序链表的公共部分
Dumpling備份數據庫
Topic34——31. Next spread
Six methods of optimizing inventory management in food production industry
Request and response must know
【C】【时间操作】C语言中关于时间的操作
Ali has been working for 8 years. This learning note is left when he reaches P8. He has helped his friends get 10 offers
Compiling 32-bit programs using cmake on 64 bit machines
《网络是怎么样连接的》读书笔记 - FTTH
基于Retrotfit2.1+Material Design+ijkplayer开发的一个APP
Figure out how MySQL works
Summary of problems and errors encountered in tidb4.0.0 (tiup deployment)