当前位置:网站首页>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>
边栏推荐
- 【实战】STM32MP157开发教程之FreeRTOS系统篇3:FreeRTOS 计数型信号量
- Dumpling備份數據庫
- Compiling 32-bit programs using cmake on 64 bit machines
- Dumping backup database
- stm32mp1 Cortex M4开发篇8:扩展板LED灯控制实验
- How to generate QR code
- android 数据库升级
- Stm32mp1 cortex M4 Development Chapter 11: expansion board buzzer control
- C # implement callback
- MySQL installation process under linux environment
猜你喜欢

Verification code ----- SVG captcha

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

Observation on the salary data of the post-90s: poor, counselled and serious

Summary of problems and errors encountered in tidb4.0.0 (tiup deployment)

Stm32mp1 cortex M4 Development Part 9: expansion board air temperature and humidity sensor control

【实战】STM32MP157开发教程之FreeRTOS系统篇6:FreeRTOS 列表和列表项

\Processing method of ufeff

Abstractqueuedsynchronizer (AQS) source code detailed analysis - semaphore source code analysis

stm32mp1 Cortex M4开发篇11:扩展板蜂鸣器控制

声临其境 — 音频沉浸体验
随机推荐
Summary of problems and errors encountered in tidb4.0.0 (tiup deployment)
The internal structure of MySQL and how an SQL statement is executed
The way of filling holes in APK Decompilation
PingCAP 入选 2022 Gartner 云数据库“客户之声”,获评“卓越表现者”最高分
Retrofit extended reading
Merge sort of sorting
Topic34——31. Next spread
智能制造的下一站:云原生+边缘计算双轮驱动
MOOC course of Nanjing University of Technology: Fundamentals of program design (Ⅰ) Chapter 8 answer and analysis of multiple choice test questions
Shortcut keys accumulated when using various software
R language uses as The character function converts date vector data to string (character) vector data
Waiting in webdriver
stm32mp1 Cortex M4开发篇9:扩展板空气温湿度传感器控制
leetcode:打印两个有序链表的公共部分
adb使用技巧和usb通信原理
[Mgt] model Mgt for code interpretation
Markdown basic syntax
【实战】STM32 FreeRTOS移植系列教程1:FreeRTOS 二值信号量使用
Abstractqueuedsynchronizer (AQS) source code detailed analysis - condition queue process analysis
Retrofit扩展阅读