Tuesday, 13 August 2013

Keypress event for ajax call does not work

Keypress event for ajax call does not work

I'm trying to do the same event. "Click" to call the ajax, however now
with keypress will put all the code and tell you where I think this error.
jquery:
$(document).ready(function () {
// Call Ajax Click <----- THIS WORK
$('.container-list-podcast').on('click', '.link-podcast', function (e) {
e.preventDefault();
$('.video').attr('src', this.href);
});
// Call Ajax Key Enter <----- THIS NOT WORK
$('.container-list-podcast').on('keypress == 13', '.selected',
function (e) {
e.preventDefault();
$('.video').attr('src', this.href);
});
});
JSFIDDLE AND COMPLETE CODE

No comments:

Post a Comment