nextPage ? help me !!

Discussion in 'Google API' started by Gizlen, Apr 24, 2012.

  1. #1
    hi,

    i get data from google but only first 10. I want to button like 2,3,4,5 then get result of next pages and show on user.


    <html>
      <head>
        <title>JSON/Atom Custom Search API Example</title>
      </head>
      <body>
        <div id="content"></div>
        <script>
          function hndlr(response) {
    	  
    	  
          for (var i = 0; i < response.items.length; i++) {
            var item = response.items[i];
    		var link = item.link;
    		
    		
            document.getElementById("content").innerHTML += "<br><a href=\"" + link + "\"><br>" + item.title + "</a><br>" + item.htmlSnippet + "<br>";
    		
          }
    	  var allres = response.searchInformation.formattedTotalResults;
    	  
    	  document.write('<br>Show '+i+' result<br>');
    	  document.write('<br>Total result: '+allres+'<br>');
        }
        </script>
        <script src="https://www.googleapis.com/customsearch/v1?key=-----API-KEY---&cx=017576662512468239146:omuauf_lfve&q=software+eng+filetype=pdf&callback=hndlr&start=1">
        </script>
    	
    	
      </body>
    </html>
    HTML:
     
    Gizlen, Apr 24, 2012 IP
  2. inout

    inout Greenhorn

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #2
    when you construct the url for reading specify start count if i am not mistaken use for example &start=1 for first 10 result &start=2 for next page and so on
     
    inout, Aug 8, 2012 IP
  3. webcycloneindia

    webcycloneindia Active Member

    Messages:
    170
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    thankx for help...
     
    webcycloneindia, Mar 8, 2013 IP