Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Friday, October 24, 2014
Using ajax in filter or search
Assume we have a form:
<form id="filterForm">
<input type="button" id='FilterButton' value="Filter" />
</form>
We we click the Filter button
$(document).ready(function(){
$('#FilterButton').click(function(){
submitFilter();
});
}
submiteFilter function using ajax
function submitFilter(){
$.post('handlesubmit.php', $("form#filterForm").serialize(), function(data) {
formatJson(data, 'div.ajax_list', setDefaultContent);
});
}
function setDefaultContent is used to handle the data from ajax post.
function setDefaultContent(formattedJson){
}
Labels:
ajax
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment