How do I make datepicker and selectmenu work in GAS?
This is my code:
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/overcast/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script>
$(document).ready(function(){
try{
$( "#datepicker" ).datepicker(
{showAnim: 'slideDown'}
);
$( "#horizonte" ).selectmenu();
}catch(err){
Logger.("erro: "+err.message);
}
})
</script>
And it isn't working, no errors are logged. I tried with JQuery 1.9.1 and only datepicker works.
I also tried this code in JSFiddle and it worked OK
Updated the jsFiddle - both work.
And this works in GAS / HtmlService:
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<div>
<form action="#">
<fieldset>
<p>Date:
<input type="text" id="datepicker"/>
</p>
<label>Escolha:</label>
<select id="horizonte">
<option value=1>1 Mês</option>
<option value=2>2 Meses</option>
<option value=3 selected="selected">3 Meses</option>
<option value=6>6 Meses</option>
</select>
</fieldset>
</form>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script>
/**
* On document load
*/
$(function() {
$( "#datepicker" ).datepicker(
{showAnim: 'slideDown'}
);
$("#horizonte").selectmenu();
});
</script>
The only difference between the two is in how <script>
tags are terminated.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.