[thelist] RE: Javascript - New Window + Search Function - Still

Tim Kuhn TKuhn at thecreek.com
Tue Oct 11 16:23:38 CDT 2005


 This is the script that you submitted:

<script language="JavaScript" type="text/javascript">
//<![CDATA[
<!--
function startSearch(){searchString =
document.searchForm.searchText.value;if(searchString
!= ""){searchEngine =
document.searchForm.whichEngine.selectedIndex + 1;finalSearchString =
"";

if(searchEngine == 1){finalSearchString =
"http://www.altavista.com/cgi-bin/query?pg=q&what=web&q="
+ searchString;}

//Several other "if's" here...

if(searchEngine == 18){finalSearchString =
"http://de.search.yahoo.com/search/de?p=" + searchString;}location.href
= finalSearchString;}}//
-->

//]]>
</script>

This is the script that responded with:

<script language="JavaScript" type="text/javascript">
//<![CDATA[
<!--
function startSearch()
  {
  	searchString = document.searchForm.searchText.value;

		if(searchString!= "")
			{
  		 		searchEngine =
document.searchForm.whichEngine.selectedIndex + 1;
				 finalSearchString = "";
			}
 
      if(searchEngine = 1)
        {
        	finalSearchString =
"http://www.altavista.com/cgi-bin/query?pg=3Dq&what=3Dweb&q=3D" +
searchString;
        }

  //Several other "if's" here...

    if(searchEngine = 18)
      {
    	finalSearchString = "http://de.search.yahoo.com/search/de?p=3D"
+ searchString;
      }
   location.href = finalSearchString;
}

//-->
//]]>
</script>

Look to see how the two are different and you will see where the syntax
was wrong. I don't know if the logic works, I only fixed the syntax.



>Thanks for the reply. Could you explain..."compare...
>[which] version"?

>Thanks.
>David


		


More information about the thelist mailing list