Results 1 to 3 of 3

Thread: two scripts interfering with each other

  1. #1
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    612
    Thanks
    46
    Thanked 32 Times in 32 Posts

    Default two scripts interfering with each other

    1) Script Title: SAG Content Scroller v1.3

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...agscroller.htm

    3) Describe problem: I used the script above here-(no search.js here)
    http://www.web-user.net/sag/testsag2.htmlAnd it works fine.

    When I add a script to it for another part of my web page it stops working.I know it is the search.js script messing things up but I don't know why.

    Here is the page with the search.js on it.
    http://www.web-user.net/sag/testsag.html

    this is the search.js script

    Code:
    /* This script and many more are available free online at
    The JavaScript Source :: http://javascript.internet.com
    Created by: Ivan Iraola :: http://www.cybexmag.com */
    
    function DoSearch() {
      var Flag = 0;
    
      if (document.ToolBox.SearchOption[0].checked==true) {
        var Flag = 1;
        var Engine = document.ToolBox.SearchOption[0].value;
        var Query = document.ToolBox.SearchBox.value;
        var locName = "http://www.google.com/search?hl=en&q=";
          if (Query == "") {
            alert("Please enter a search term");
            return;
          }
        location.href = (locName + Query)
      }
    
      if (document.ToolBox.SearchOption[1].checked==true) {
        var Flag = 1;
        var Engine = document.ToolBox.SearchOption[1].value;
        var Query = document.ToolBox.SearchBox.value;
        var locName = "http://www.bing.com/search?q=";
          if (Query == "") {
            alert("Please enter a search term");
            return;
          }
        location.href = (locName + Query)
      }
    
      if (document.ToolBox.SearchOption[2].checked==true) {
        var Flag = 1;
        var Engine = document.ToolBox.SearchOption[2].value;
        var Query = document.ToolBox.SearchBox.value;
          if (Query == "") {
            alert("Please enter a search term");
            return;
          }
        var searchPage = "<HTML>";
          searchPage += "\n";
          searchPage += "<FRAMESET ROWS=\"50%,50%\">";
          searchPage += "\n";
          searchPage += "<FRAME SRC=\"http://www.google.com/search?hl=en&q=" + Query + "\">";
          searchPage += "\n";
          searchPage += "<FRAME SRC=\"http://search.yahoo.com/search?p=" + Query + "\">";
          searchPage += "\n";
          searchPage += "</FRAMESET>";
          searchPage += "\n";
          searchPage += "</HTML>";
          document.write(searchPage);
      }
    
      if (Flag == 0) {
        alert("Please select a search engine");
      }
    }
    Thanks,Bud
    Last edited by ajfmrf; 05-28-2011 at 05:48 AM. Reason: made mistake

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Typo (missing closing angle brace on the second script tag):

    Code:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <title> test sag scroller </title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    
    <link rel="stylesheet" type="text/css" href="sagscroller.css" />
    <script type="text/javascript" src="search.js"</script>
    <script type="text/javascript" src="sagscroller.js">
    
    /***********************************************
    * SAG Content Scroller- � Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    </script>
    Let's zoom in. That line:

    Code:
    <script type="text/javascript" src="search.js"</script>
    should be:

    Code:
    <script type="text/javascript" src="search.js"></script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    ajfmrf (05-28-2011)

  4. #3
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    612
    Thanks
    46
    Thanked 32 Times in 32 Posts

    Default oh my g...

    Good grief John, I must be as dumb as rain-lol

    I stared at that,cut pasted and more but never noticed the obvious.

    Thanks again my friend

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •