samoual 0 Newbie Poster

Hi iam i have web app to get from data from webservice , in the text box you will search for name you will get the name and the ID i wanna get the ID and pass it to other function to get the Name detail .
here is my code
i want to get the bookID and pass it to the other function .

function findByName() {
    console.log("Find by name start")
        service.findByName($('.search-key').val()).done(function (books) {
            var l = books.length;
            var e;
            $('.book-list').empty();
            for (var i = 0; i < l; i++) {
                e = books[i];
                $('.book-list').append('<li><a href="#bookdetail/' + e.bookid + '">' + e.bookname +  '</a></li>');
            }
        });
    }
      ( function(id) {

            service.findByIdBook(parseInt(id)).done(function(book) {
                console.log('details');
            });
        });

`

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.