Skip to content

Instantly share code, notes, and snippets.

@StevenLangbroek
Created June 28, 2012 15:38
Show Gist options
  • Save StevenLangbroek/3012063 to your computer and use it in GitHub Desktop.
Save StevenLangbroek/3012063 to your computer and use it in GitHub Desktop.
EE AJAX Biznizz
$(document).ready(function(){
$('.search_form').submit(function(e){
e.preventDefault();
var $this = $(this);
var theData = $this.serialize();
var theUrl = $this.attr('action');
$.post(theData, theUrl, function(data){
var results = data.find('tbody').html();
$('tbody#ajax-results').html(results);
var searchform = data.find('form.save_search_form').html();
$('form.old_save_search_form').html(searchform);
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment