F A JavaScript Search Engine Using Frames

Making a JavaScript Search Engine in Frames

The only difference, in relation to the search engine, between this page and the previous one is the code below. The change is shown in red. To understand this, if necessary, go to the page on frames.

<script type="text/javascript">

<!--//

function go(){

/* When our user presses the button (in the form) we check to see if anything has been selected. Also we don't want the first selection which is 'Results' or the sorry message. */

if (document.F187.MySelect.selectedIndex>0){

parent.myMain.location=document.F187.MySelect.options[document.F187.MySelect.selectedIndex].value

}

else {

alert('Please select an option.')

}

}

//-->

</script>

Of course, you need to move the form and the code to the side page, or wherever you want it, and you may also have to change the page targets, so the pages load where you want them. For instance, I used: You can learn about frames in the HTML Tutorial, going to the page about base targets in frames (Frames - Getting to the target!).

 

And for some programming for your brain: check out New Life Course