Submitting form via ajax, one way or two ways?

AzelGS

New Member
What's better of this two options:\[code\]1. $.post( '/ajax/action', function(data) { doResult(); } );*This option has to receptors: ajax.php and action.php*\[/code\]or\[code\]2. $.post( '/action', { typerequest: 'ajax' }, function (data) { doResult(); }*This option has only 1 receptor: action.php (if typerequest exists, returns ajax result)*\[/code\]Form without ajax looks like:\[code\]<form action="/action">\[/code\]
 
Back
Top