Reputation: 3
Lately, I've been working on a page in html which is supposed to search Google. I have a search box and a button but I'm wondering what the most efficient way to get the results from Google and display them on my page. If anyone knows I'd be glad if they helped me out.
{EDIT}
This is just a little project I'm working on. To be more specific I'd like to make it where what is typed in the search box gets taken from www.google.com/search and then the results of the Google search are displayed below.
Upvotes: 0
Views: 1472
Reputation: 1847
So you're saying you want an HTML page with a single input and a submit button.
When the user enters text into the input and then presses submit what would you like to happen?
I see two basic approaches.
[UPDATE}
after looking into this it seems that XMLHttpRequest will not work with google and that the API is the way to go. source
Upvotes: 0
Reputation: 4135
You can create a custom google search engine for your sites, follow the steps, then get the code and paste it in a div
inside the body
tag. Here is a JSFiddle with an example of this (site:stackoverflow.com).
You can then edit the way the engine looks in the look and feel tab in the edit search menu.
Hope this helps, good luck! :)
Upvotes: 1