|
When I started I started teaching option/info/anglais I got a lot of stuff that was created, altered or pirated by my students. From programs that allow you to put images in a warcraft game to textures for PSP. Great fun but not necessarily useful. The idea and the code was given to me by Raphael,Heiss, Class of 1995. Here is his page: This is here is his tutorial: This page has a little different code but I think since you have two different tutorials you should be able to figure out how to create your own page. The scripts are quite functional in that it allows many searches from one page. If you limit the size of the new window the results will posted in a new window so you never leave the search page.I don't like that you may by including width and height parameters in your new window. Example: old>>>>> wind=window.open(search1,"newwindow1","scrollbars=yes"); new>>>> wind=window.open(search1,"newwindow1","width=700, height=300, scrollbars=yes"); It is really neat because you can follow several different paths at the same time. And maybe type an essay while you are waiting for all the pages to load. Another thing is this allows you to customize the page. You can make an all German search engine page or one that specializes in a subject like the environment or advanced mathamatics. If you want to save time:
As with most scripts that include FORM elements, Let's start with them. The form code looks like this:
<FORM NAME="searching"> Okay, three things to look for here. First is the text box where the user enters the keyword to be searched. The second is the code that allows the choice of search engines, and third is the button that triggers the function to search. NAMEs The name of the FORM itself is "searching." The text box name is "query." Each of the Checkboxes are given the name of the search engine they represent.
Finally, the button will trigger a function called Now we know enough to start constructing hierarchy statements, but unlike other forms, this has multiple hierarchy statements depending on what the user chose. We'll get into how the JavaScript knows which has been clicked later. The Checkboxes Yes, this could have also been done with radio buttons and, with some special coding, a drop-down menu. The reason the author chose checkboxes is that it allowed the user to check as many as desired. This doent limit the choice. Let's look at the first checkbox code:
<INPUT TYPE="checkbox" NAME="yahoo" It's a basic INPUT TYPE="checkbox" format. This checkbox represents Yahoo!, so that's the NAME. Now, here's the trick. See the VALUE? That VALUE is the URL that attaches to the Yahoo! search engine. If you attached the keywords entered by the user to the end of that URL, you'd get a search performed. Same with the other four checkboxes. The VALUEs are equal to the URL required to perform a search on that particular engine. The code is pretty easy to find. You just go to the search page of the engine and look at the source code. I'm sure that's where the author got it. So we have a text box that assigns the variable "query" to keywords. We also have checkboxes that return URLs of search engines. Put the two together and you get a full search string. Seeing the process yet?
|