2012-09-02 4 views
1

Google App Script에서 jquery 플러그인을 사용할 수 있는지 궁금한가요? jquery tablesorter를 사용하여 간단한 html을 작성하려고했지만 작동하지 않습니다. html은 스타일을 렌더링하지만 테이블 내에는 tablesorter 함수가 없다. 헤더를 클릭하면 테이블을 정렬한다고 가정하지만 각 헤더를 클릭 할 때 수행되는 작업은 없습니다. .html에 똑같은 코드를 복사하여 붙여 넣기하고 wampserver에서 테스트하면 작동합니다. 내 코드는 아래와 같습니다. 어떤 조언을 해주시겠습니까?jquery tablesorter가있는 Google App 스크립트가 작동하지 않음

<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> 
+0

[caja playground] (http://caja.appspot.com/)에서 테스트 할 수 있습니다. –

+0

에는 외부 jquery 플러그인이 있어도 GAS에서 사용할 수 있습니까? 나는 카자 놀이터에 갔어. URL과 Cajole을로드하여이 caja 컴파일러에서 작동하는지 확인합니다. – Alex

답변

0

명시 적 jQuery를 플러그인에 대한 제한하지만, 안전하지 않은 작업을 사용하는 경우 HtmlService가 사용하는 자바 스크립트 라이브러리를 거부 할 수있는 카하 엔진이 있습니다. 의견에서 언급 한 바와 같이 Caja Playground을 사용하여 HTML과 JavaScript가 유효성 검사를 통과하는지 확인하십시오.

관련 문제