私は本当に単純なhtml tableTreeを作ろうとしています。私はhtml/javascriptプログラミングに関する経験がないので、私が達成しようとしているものの例を見つけるためにグーグルを横断しています。
私は現在、jsonファイルをhtmlドキュメントに渡す簡単な方法を見つけようとしています。そのコード部分を自分で実行し、ajaxとjqueryを使用することで成功しました。
ただし、jqote2 を使用した例を見つけましたが、この例を実装すると、「Uncaught TypeError: undefined is not a function」というエラーが表示されます。私は何かが足りないと思いますが、何がわからないので、ここで助けを得られることを願っています:)
<!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'));
だから私は何が欠けているのですか:)私はチェックしましたが、含まれているファイルは存在し、パスは正しいです。