The problem is that I want to display the XML data as plain HTML text on the same page when submitting (so in a div). I have Googled for this but There is nothing on the internet that can solve my problem. However I think it is possible to show the XML data using Javascript. But I think that I would have a hard time trying since the XML is not in the same root.
Any help is appreciated. If you don't want to write the code please point me in the right way.
Please take a look at www.begin.nl (a dutch starting page) They are using the google suggestions in XML format with this url: ''http://www.google.com/complete/search?hl=nl&q='' , I think with json.
I would really like to understand how they are doing it so I can alter the code in an original code that I can use. I don't want to copy/paste there code since they did all the hard work.
Hi rnd me, Thank you very much but it is not perfect..Its giving me a different suggestion list than the original. I think it has something to do with the url but Im not sure. I will try to figure it out.
(Less important: It would be helpful to explain to me what you have done here, it looks like plain javascript to me but I could be mistaken. Why did you put the list as an option list, and why the timer?)
Why did you put the list as an option list, and why the timer?)
it's just a demo, you should modify the html making part as you see fit; since there's no xml and i don't know how you want the data displayed, i choose a select since it's simple to populate with suggestions.
the timer removes the script tags from old suggestion dispatches, freeing up memory. otherwise, they can accumulate and if nothing else, they slow down firebug.
Hi rnd me, I think I would prefer a simple div/ul/li because I can do more with it than the option list, I will look more in to this and try to figure it out. nevertheless this is more than I could have hoped for Thanks for your time and effort. I have changed the url in to this: "http://www.google.nl/complete/search?callback=suggest&q=" So now there is no "junk(?)" in the suggestions and it is exactly like the original.
Bookmarks