How to launch a google search in a new tab or window from javascript?

前端 未结 4 594
灰色年华
灰色年华 2020-12-09 07:02

Say I have a Javascript variable containing a couple of search terms separated by spaces, is it possible to start a Google Search window or tab using these terms (after a us

4条回答
  •  一向
    一向 (楼主)
    2020-12-09 07:28

    Sure just pass a link with google search parameters to a new window / div / ajax div / iframe However you cannot just open a new tab / window, this is not allowed and not recommended. You need to add a button that will open it..

    Guide to Google Search Parameters:

    1)http://www.seomoz.org/ugc/the-ultimate-guide-to-the-google-search-parameters

    2)http://www.blueglass.com/blog/google-search-url-parameters-query-string-anatomy/

提交回复
热议问题