如何让 jQuery 移动设备使用应用程序脚本?
How do I get jQuery mobile to work with app script?
我正在尝试使用 google 应用程序脚本、google 工作表和 jquery 移动设备构建网络应用程序。
我的 html 仅显示为未格式化的文本,我在浏览器控制台中收到以下错误消息:
error message
我在这个post中注意到他们的html代码和我的一样,至少我认为是:
在他们的 posted 截图中,它显然是有效的,尽管他们有一个单独的缩放级别问题。
这是我的 html:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">
<?!= include('JavaScript');?>
</head>
<body>
<div data-role="page" class="page" id="pgHome" data-title="My Page Title">
The rest of my html basically follows the boilerplate html from jquery.
这是我的应用脚本代码:
function doGet() {
return HtmlService.createTemplateFromFile('myHtml').evaluate().setTitle("TAH Inventory Management");
}
function include(filename) {
return HtmlService.createTemplateFromFile(filename).evaluate().getContent();
}
我的 JavaScript.html 文件包含从 google 张中填充 UL 的脚本。
知道为什么来自 jquery 移动设备的 none 结构或样式有效吗?
我也尝试使用 jquery 手机本身的代码段,但也没有用。
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
我非常感谢在这方面能得到的任何帮助。提前致谢。
显然我的问题是 jquery 手机和 jquery 3 之间的不兼容性,如 post 中所述:
我将代码更改为以下内容,现在可以使用了!
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">
我正在尝试使用 google 应用程序脚本、google 工作表和 jquery 移动设备构建网络应用程序。
我的 html 仅显示为未格式化的文本,我在浏览器控制台中收到以下错误消息:
error message
我在这个post中注意到他们的html代码和我的一样,至少我认为是:
在他们的 posted 截图中,它显然是有效的,尽管他们有一个单独的缩放级别问题。
这是我的 html:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">
<?!= include('JavaScript');?>
</head>
<body>
<div data-role="page" class="page" id="pgHome" data-title="My Page Title">
The rest of my html basically follows the boilerplate html from jquery.
这是我的应用脚本代码:
function doGet() {
return HtmlService.createTemplateFromFile('myHtml').evaluate().setTitle("TAH Inventory Management");
}
function include(filename) {
return HtmlService.createTemplateFromFile(filename).evaluate().getContent();
}
我的 JavaScript.html 文件包含从 google 张中填充 UL 的脚本。
知道为什么来自 jquery 移动设备的 none 结构或样式有效吗?
我也尝试使用 jquery 手机本身的代码段,但也没有用。
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
我非常感谢在这方面能得到的任何帮助。提前致谢。
显然我的问题是 jquery 手机和 jquery 3 之间的不兼容性,如 post 中所述:
我将代码更改为以下内容,现在可以使用了!
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">