开发者

google search won't open in new page

I expect the following code to open the results of a google search in new window but it doesn't. Does anyone have any suggestions?

<body>

<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', {langu开发者_JAVA技巧age : 'en'});
  google.setOnLoadCallback(function() {
    var customSearchControl = new     google.search.CustomSearchControl('001782268784890582031:k30dxi2nexc');
    customSearchControl.setResultSetSize(google.search.Search.SMALL_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" />-->


</body>


No, you misunderstood the meaning of google.search.Search.LINK_TARGET_BLANK

this code should produce following search results: links with target=_blank.

Search results though will show up in the same window.

for reference - please see: http://code.google.com/apis/websearch/docs/reference.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜