I need have to carry the description of the title when clicking "enter", I created a variable for the path of the description:
var descri = json.query.results.channel.item.map(function (item) {
return item.summary;
});
And this code, jQuery to call the the variable when you click enter:
$(document).on('keypress', function (e) {
if (e.which == 13) {
//I think the error is here:
$('.description').html('descri');
}
e.preventDefault();
});
Use this
success: function (json) {
/* Other things */
// description
var description = json.query.results.channel.item.map(function (item) {
return item.summary;
});
// Call Ajax Key Enter
$(document).on('keypress', function (e) {
if (e.which == 13) {
$('.description').html(description);
}
e.preventDefault();
});
/* Other things */
}
If I understood your question correctly then here is your answer below.
if (e.which == 13) {
$('.description').html($(".nav_holder li.selected").text());
}