$(document).ready(function() { $.setAjaxForm('#editForm',function(response) { if(response.result == 'success') { var ref = $('#ajaxModal').attr('ref'); if(v.ref == ref) { location.reload(); } else { $.reloadAjaxModal(1200); } } }); });