see this http://javascript.internet.com/forms/multiple-search-engine.html . i wonder how to open the search result in new window. help me!
views:
100answers:
2
+3
A:
1) Don't do that
2) Really don't do that
3) In the case that you have to do that, bind a function to the onclick event of the "search" button. Inside the function, use window.open to pop up a new window with the address you want to send the user to. Depending on how the user configured his browser, the browser may instead open another tab. At the end of the function, return false.
OK actually there's no need to write any other code because the form is already JS-driven. In the source of that page you linked to, find the following line:
location.href = finalSearchString;
Substitute it with the following line:
window.open(finalSearchString, 'Search results');
That's it. The button will pop up another page or tab.
WARNING
That page is somewhat outdated and some of the search engines don't work properly (the link generated is wrong).
Kaze no Koe
2009-12-17 09:14:39
Kaze, please SHOW the example to me and to people. TQ.
Heypy.com
2009-12-20 09:08:07
My explanation requires only basic JS skills, if you want me to post working code then please add the relevant HTML fragment to your question and specify if you're using a particular JS framework.
Kaze no Koe
2009-12-21 08:30:57
please3.... stackoverflow has so much JS experts here.. check out this: http://javascript.internet.com/forms/multiple-search-engine.html THEN give a relevan answer how to open the search result in new window. I mean, please send the complete source code to my email address: info @ heypy.com . You help me, i'll advertise your website in my website for 1 year. TQ.
Heypy.com
2009-12-23 02:19:33
Done, don't worry about linking to my site.
Kaze no Koe
2009-12-23 07:48:56
it not works with IE
Heypy.com
2009-12-23 12:25:13