我想做一個非常簡單的html tableTree。我沒有任何有關html/javascript編程的經驗,所以我遍歷谷歌找到我試圖實現的例子。Uncaught TypeError jqute
我目前正在試圖找到一個簡單的方法來傳遞一個json文件到一個html文檔中,並且我通過執行代碼部分我自己並使用ajax和jquery已經取得了成功。
但是我發現了一個使用jqote2的例子,雖然實現這個例子給了我一個錯誤「Uncaught TypeError:undefined不是一個函數」。我想我失去了一些東西,雖然我想不出什麼,所以我希望我能得到一些在這裏:)援助
<!DOCTYPE html>
<html>
<head>
<script src="jquery/jquery-1.11.2.min.js"></script>
<script src="jqote2/jquery.jqote2.js"></script>
<script type="text/html" id="template">
<![CDATA[
<tr>
<td class="no"><%= j+1 %></td>
<td class="title"><%= this.Title %></td>
</tr>
]]>
</script>
<!-- 2 load the theme CSS file -->
<title>Test</title>
</head>
<body>
<script type="text/javascript">
var jsondata = [{"Title": "Dr.", "Surname": "House", "Firstname": "Geronimo"},{"Title": "Mr.", "Surname": "Franklin", "Firstname": "Benjamin"}];
// Now call jQote on the template providing your json data
$('#template').jqote(jsondata).appendTo($('#users'));
</script>
<div>
<table id="users"></table>
</div>
</body>
</html>
我已經基於在http://aefxx.com/jquery-plugin/jqote/
發現的例子建立這個代碼當運行此代碼我得到錯誤的
$('#template').jqote(jsondata).appendTo($('#users'));
所以我失去了什麼:)我已經檢查幷包含文件確實存在和路徑是正確的。
我們在這裏談論什麼解析器因爲我明白它