What I want to do is, when someone clicks on any of the link displayed
when he/she searches for a book, I wanted to show the book!.

I know it sounds simple but I dont kwnow whats going on.

Here's my code:
google.load("books", "0");
google.load("search","1");

 function openBook(isbn){
                var viewer = new
google.books.DefaultViewer(document.getElementById('viewerCanvas'));
                viewer.load(isbnNumber);
            }

 function searchComplete() {
                // Check that we got results
                document.getElementById('content').innerHTML = '';
                if (bookSearch.results && bookSearch.results.length >
0) {
                    for (var i = 0; i < bookSearch.results.length; i+
+) {

                        // Create HTML elements for search results
                        var p = document.createElement('p');
                        var a = document.createElement('a');
                        a.href = window.location.href;
                        a.setAttribute("onclick", "openBook('"+
(bookSearch.results[i].bookId).toLocaleString() +"')");
                        a.innerHTML = bookSearch.results[i].title;
                        p.appendChild(b);
                        // Append search results to the HTML nodes
                        p.appendChild(a);
                        document.body.appendChild(p);
                    }
                }
            }

Can you please help me out on this.

Cheers.

--
Kido.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to