2013-10-05 38 views
0

我有這樣的代碼,在同一頁面上Google搜索結果獲取URL谷歌搜索同一個頁面

<div id="cse" style="width: 100%;">Loading</div> 
    <script src="http://www.google.com/jsapi" type="text/javascript"></script> 
    <script type="text/javascript"> 
     google.load('search', '1', {language : 'en'}); 
     google.setOnLoadCallback(function() 
     { 
     var customSearchControl = new google.search.CustomSearchControl('XXXX:XXXX'); 
     customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); 
     customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_BLANK); 
     customSearchControl.draw('cse'); 
     }, true); 

    </script> 
    <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /> 

但我希望搜索結果顯示在同一頁面上點擊後鏈接

是什麼一個URL要做到這一點?

例子:

https://www.mysite.com/search?q= 

<a href="https://www.mysite.com/search?q=food">food</a> 

回答