我正在使用phonegap和jquery构建一个android应用程序,这对所有这些都是相当新的。
它在phonegap软件上运行良好,并且可以链接到我的android手机,但是当我以apk形式创建项目并在手机上打开它时,所有jQuery都不起作用(基本上所有页面都被合并为一个页面)。
我尝试将CDN库更改为托管,并尝试对配置文件进行所有不同的操作,但是没有任何效果。
有人可以帮我解决问题吗?
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>BassGuitar Quiz</title>
<meta http-equiv="Content-Security-Policy" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="jquery.mobile-1.4.5.min.css" />
<script src="jquery.mobile-1.4.5.min.js"></script>
<link rel="stylesheet" href="style.css">
<script src="main.js"></script>
</head>
<body>
config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.bassguitarquiz" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>BassGuitar Quiz</name>
<description>
A bass guitar buying guide application.
</description>
<author email="rourkebradley@gmail.com" href="http://phonegap.com">
PhoneGap Team
</author>
<preference name="permissions" value="none"/>
<!-- Customize your app and platform with the preference element. -->
<preference name="phonegap-version" value="cli-8.1.1" />
<!-- all: current version of PhoneGap -->
<preference name="orientation" value="default" />
<!-- all: default means both landscape and portrait are enabled -->
<preference name="target-device" value="universal" />
<!-- all: possible values handset, tablet, or universal -->
<preference name="fullscreen" value="true" />
<!-- all: hides the status bar at the top of the screen -->
<!-- Define app splash screen for each platform. -->
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:density="ldpi" />
<gap:splash src="res/screen/android/screen-mdpi-portrait.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="res/screen/android/screen-hdpi-portrait.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi" />
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
</widget>