Skip to main content
se añadieron 27 caracteres en el cuerpo
Origen Enlace

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
        e.preventDefault();
        return false;
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
        return false;
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
        e.preventDefault();
        return false;
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

se añadieron 27 caracteres en el cuerpo
Origen Enlace

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
        return false;
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
        return false;
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

se añadieron 3 caracteres en el cuerpo
Origen Enlace

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        varBuscar();
 searchField =  }
});

$('#search''#btnSearch').valclick(function(); {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

        $.getJSON('/books-schema.json', function(data) {
            var output = '<ul id="resultado">';

            $.each(data.data, function(key, item) {
                if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
                    output += '<li>';
                    output += '<span class="image"><img src=' + item.image + '/></span>';
                    output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
                    output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
                    output += '</li>';
                }
            });
            output += '</ul>';
            $('content').html(output);
        });
    }
});

Saludos,

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        var searchField = $('#search').val();
        var myExp = new RegExp(searchField, 'i');

        $.getJSON('/books-schema.json', function(data) {
            var output = '<ul id="resultado">';

            $.each(data.data, function(key, item) {
                if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
                    output += '<li>';
                    output += '<span class="image"><img src=' + item.image + '/></span>';
                    output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
                    output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
                    output += '</li>';
                }
            });
            output += '</ul>';
            $('content').html(output);
        });
    }
});

Saludos,

Intenta con este código :

$('#search').keypress(function(e) {
    var keycode = (e.keyCode ? e.keyCode : e.which);
    if (keycode == '13') {
        Buscar();
    }
});

$('#btnSearch').click(function() {
    Buscar();
});

function Buscar() {
var searchField = $('#search').val();
var myExp = new RegExp(searchField, 'i');

$.getJSON('/books-schema.json', function(data) {
    var output = '<ul id="resultado">';

    $.each(data.data, function(key, item) {
        if ((item.title.search(myExp) != -1) || (item.teaser.search(myExp) != -1)) {
            output += '<li>';
            output += '<span class="image"><img src=' + item.image + '/></span>';
            output += '<span class="title">' + '<h3>' + item.title + '</h3>' + '</span>';
            output += '<span class="description">' + '<p>' + item.teaser + '</p>' + '</span>';
            output += '</li>';
        }
    });
    output += '</ul>';
    $('content').html(output);
});

}

Saludos,

Origen Enlace
Loading