我需要能够根据所选择的菜单下降项目显示表的变化。 我不知道用javascript写什么。 我迄今为止的法典是:
JS:
//change table viewed
$("#view").change( function (event) {
$.getJSON( view.php?view= + $(this).val(), function (json) {
});
});
传真:
<div>
View: <select id="view"><option value="failed">Failed</option><option value="pending">Pending</option><option value="both">Both</option></select>
<table id="jobs-failed" border="1">
<tr><th>ID</th><th>Media</th><th>Playlist</th><th>Input</th><th>Output</th><th>Bit Rate</th><th>Status</th><th>Encoder</th><th>Progress</th></tr>
<tr><td>2851</td><td>1849474</td><td>367</td><td>txt</td><td>html</td><td>best</td><td>failed</td><td>encvm2</td><td>NULL</td></tr>
</table>
<table id="jobs-pending" border="1">
<tr><th>ID</th><th>Media</th><th>Playlist</th><th>Input</th><th>Output</th><th>Bit Rate</th><th>Status</th><th>Encoder</th><th>Progress</th></tr>
<tr><td>2344</td><td>1843278</td><td>455</td><td>mp3</td><td>wav</td><td>best</td><td>pending</td><td>encvm1</td><td>NULL</td></tr>
</table>
<table id="jobs-both" border="1">
<tr><th>ID</th><th>Media</th><th>Playlist</th><th>Input</th><th>Output</th><th>Bit Rate</th><th>Status</th><th>Encoder</th><th>Progress</th></tr>
<tr><td>2851</td><td>1849474</td><td>367</td><td>txt</td><td>html</td><td>best</td><td>failed</td><td>encvm2</td><td>NULL</td></tr>
<tr><td>2344</td><td>1843278</td><td>455</td><td>mp3</td><td>wav</td><td>best</td><td>pending</td><td>encvm1</td><td>NULL</td></tr>
</table>
</div>
感谢!