我无法在我的GAS项目中使用jQuery警报。我能够包括这样的基本jquery库:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
但是,如果我尝试使用jAlert包括这些内容:
<script src="https://jquery.alerts.js" type="text/javascript"></script>
<link href="https://jquery.alerts.css" rel="stylesheet" type="text/css">
我在控制台中收到一条错误消息:“ net :: ERR_NAME_NOT_RESOLVED”。
如何包含供GAS使用的jquery警报库?
注意:jquery.alerts.js网站是否处于活动状态?我在那里看不到任何内容(我是新手。我不知道该网站应该存在还是不存在)。
您可以在Google Apps脚本项目中添加jquery.alerts源。在Google Apps脚本项目中,创建html文件jquery.alerts.css.html并将其源代码放入标记样式中,例如
<style> popup_container { font-family: Arial, sans-serif; font-size: 12px; min-width: 300px; /* Dialog will be no smaller than this */ /*...and other code*/ </style>
比创建HTML文件jquery.alerts.js.html并将源代码放入标记脚本中,例如
<script type="text/javascript"> (function($) {
$.alerts = { verticalOffset: -75, horizontalOffset: 0, repositionOnResize: true, /*...and other code*/ </script>
然后,当您可以将此库与html服务一起使用时。例:
<html> <?!= include('jquery.alerts.css.html'); ?> <?!= include('jquery.alerts.js.html'); ?> <head> <base target="_top"> </head> <body> <div> <a href="http://google.com">Click Me!</a> </div> </body> </html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句