Force google image search

前端 未结 2 771
一个人的身影
一个人的身影 2021-01-28 16:38

I have a simple site where the top content is a navigation tab with two navigation lists: Web and Image. Under the navigation tab i have a google custom search search element/ba

相关标签:
2条回答
  • 2021-01-28 16:52

    I think you can basically create your own Google Image search form. The most important thing to know is that the URL for image search looks like:

    http://www.google.com/search?site=imghp&tbm=isch&q=Glee
    

    (Where "Glee" is your search term).

    Here's a simple example of how the form would be, HTML:

    <h1>Google Image Search</h1>
    <input type = "text" id = "srchterm"/>
    <button type = "button" onclick = "reDirect();">Search!</button>
    

    JavaScript:

    function reDirect() {
        window.location = 'http://www.google.com/search?site=imghp&tbm=isch&q=' + document.getElementById('srchterm').value;
    }
    

    Hope that helped you in any manner!

    0 讨论(0)
  • 2021-01-28 17:16

    have a look at this url:

    http://www.google.com/search?tbm=isch&q=queen

    0 讨论(0)
提交回复
热议问题