I'm wondering if it's possible to use jQuery inside local html-files loaded into a webview?
I'm trying to construct a sortable tableview using jQuery as per this page:
http://tablesorter.com/docs/
Unfortunately, my attempts are not going so well.
Below is my attempt, and it tries to automatically sort the table in ascending order of the first column. The js-files are simply dragged into the project (into the same folder as the html-file).
.html
I'm trying to construct a sortable tableview using jQuery as per this page:
http://tablesorter.com/docs/
Unfortunately, my attempts are not going so well.
Below is my attempt, and it tries to automatically sort the table in ascending order of the first column. The js-files are simply dragged into the project (into the same folder as the html-file).
.html
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=0.1, maximum-scale=1.6">
<meta name="apple-mobile-web-app-capable" content="YES">
<link rel="stylesheet" href="main.css">
<script type="text/javascript" src="jquery-1.5.1.mini.js"></script>
<script type="text/javascript" src="jquery.tablesorter.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
// call the tablesorter plugin
$("table").tablesorter({
// sort on the first column and third column, order asc
sortList: [0,0]
});
});
</script>
<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>