私はJquery
一般的にウェブプログラミングが初めてです。プラグインを使用しようとしていtablesorter
jquery
ますが、プログラムの 1 つだけが機能していないことがわかりました。微調整した後、私はそれを機能させることができませんでした。だからスタックオーバーフローに頼った。
私の間違いが何であるか説明してもらえますか?前もって感謝します :)
現在、私のhtml
ファイル(次のコード)は「jquery.tablesorter.js」と同じフォルダーにあります。以下に引用されているW3スクールのGoogle Jquery CDNを使用しようとしています:
http://www.w3schools.com/jquery/jquery_install.asp
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
}
);
</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>jsmith@gmail.com</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>fbach@yahoo.com</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>jdoe@hotmail.com</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>tconway@earthlink.net</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
</body>
</html>
for filename in os.listdir (input_dir) :
f = open(file_name, 'rb')
file_content = f.readlines()
f.close()
len_file = len(file_content)
while( i < len_file ):
line = file_content[i].split(delimiter)
i +=1
Update1:このエラーを修正できました。Google から Content Distribution を追加するとエラーが発生し、それを内部ディレクトリに変更すると問題が解決するようです。
実は私も変わったのですが、
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
この行に。
<script src="jquery-1.9.1.js" type="text/javascript" ></script>
そしてそれはうまくいきました:)
Google CDN が機能しなかった理由はありますか? ありがとう!:)
アップデート2:
コードをローカルでテストするときは、Google CDN 呼び出しの前にhttp:を追加してみてください。つまり、
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
プラグインをお楽しみください:)