Javascript 如何在新页面中显示自定义google搜索结果

Javascript 如何在新页面中显示自定义google搜索结果,javascript,html,xml,Javascript,Html,Xml,我在我的网页中使用自定义谷歌搜索 代码: 加载 load('search','1',{language:'en'}); setOnLoadCallback(函数(){ var customSearchControl=new google.search.customSearchControl('016457557644291857915:ivjbplcmt5k'); customSearchControl.setResultSetSize(google.search.search.FILTERED

我在我的网页中使用自定义谷歌搜索

代码:

加载
load('search','1',{language:'en'});
setOnLoadCallback(函数(){
var customSearchControl=new google.search.customSearchControl('016457557644291857915:ivjbplcmt5k');
customSearchControl.setResultSetSize(google.search.search.FILTERED\u CSE\u RESULTSET);
customSearchControl.draw('cse');
},对);
上面的代码工作正常,但它在该页面本身显示搜索结果。我想在单独的页面中显示搜索结果页面


需要代码帮助

如何使用“外观和感觉”选项卡中的选项Iframe

Iframe.提供有限的定制,需要单独的 页面以查看您站点上的结果


您可以使用自定义搜索API中的特殊方法,只需在setResultSetSize()之后和draw()方法之前添加此行:

链接将在新窗口中打开

我希望这能如你所愿

<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('016457557644291857915:ivjbplcmt5k');
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse');
  }, true);
</script>
customSearchControl.setLinkTarget(google.search.Search.LINK_TARGET_BLANK)