Reputation: 63
Just wondering whether we can have jquery plugin in Google App Script? I tried to write a simple html with table using jquery tablesorter but it is not working. The html renders the style but there is no tablesorter function within the table. When I click on the header, it suppose to sort the table but no action was perform when clicking on each header. I copy and paste the exact same codes into a .html and tested it on my wampserver and it works. My codes are below. Any advise please?
<html>
<head>
<link rel="stylesheet" href="http://tablesorter.com/themes/blue/style.css" type="text/css" media="print, projection, screen" />
<script type="text/javascript"src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript" src="http://tablesorter.com/__jquery.tablesorter.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#myTable").tablesorter();
});
</script>
</head>
<body>
<table id="myTable" class="tablesorter">
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Email</th>
<th>Due</th>
<th>Web Site</th>
</tr>
</thead>
<tbody>
<tr>
<td>Smith</td>
<td>John</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>[email protected]</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
</body>
</html>
Upvotes: 1
Views: 1897
Reputation: 12673
There are explicit limitations for jQuery plugins, but the Caja engine that the HtmlService uses may reject JavaScript libraries if they use unsafe operations. As mentioned in the comments, use the Caja Playground to see if your HTML and JavaScript passes validation.
Upvotes: 0