Can someone explain the jQuery equivalent of Form.event.findElement to me?
$('.ad-publish-button').bind('click', function(e) { // jquery
// section of prototype I need to convert to jquery
if ( e.findElement('.ad').down('form').down('#location').value != '' ) {
e.findElement('.ad').down('form').request();
}
});
give it a try
e.targetis the clicked element$(e.target).closest('.ad')[0]is the closest ancestor with className ‘.ad’of the element from #1 . This element is used as context for the selector ‘form’
(so it will find a form inside the .ad-element)
$.ajax()will send a request(using the form- properties action+method and the serialized elements)