Results 1 to 4 of 4

Thread: This script no longer works

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

    Default This script no longer works

    This search won't work if you select the 'both' button.

    http://www.web-user.info/search/test.html

    I am thinking google has changed something?Can it be fixed or is this being done to stop everyone from using google in this way?

    Code:
    <html>
    <head>
    <title>A great search engine script-change the search engines if you want to</title>
    <script type="text/javascript">
    <!--
    /* 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://www.bing.com/search?q=" + Query + "\">";
          searchPage += "\n";
          searchPage += "</FRAMESET>";
          searchPage += "\n";
          searchPage += "</HTML>";
          document.write(searchPage);
      }
    
      if (Flag == 0) {
        alert("Please select a search engine");
      }
    }
    //-->
    </script>
    </head>
    <BR>
    <BR>
    <div align="center">
    <table  WIDTH=720 CELLPADDING=0 CELLSPACING=0>
    <tr><td><font FACE="helvetica,arial,geneva">
    
    <table align="center">
    <tr><td>
    <form name="ToolBox">
    Search: <input type="text" name="SearchBox" size="22">
    <input type="radio" name="SearchOption" value="Google">Google&nbsp;&nbsp;
    <input type="radio" name="SearchOption" value="Bing">Bing&nbsp;&nbsp;
    <input type="radio" name="SearchOption" value="Both">Both&nbsp;&nbsp;
    <button type="button" onclick="DoSearch()">Search</button>
    
    </form>
    </td></tr>
    </table>
    
    
    
    
    
    
    
    </body>
    </html>
    Last edited by ajfmrf; 01-20-2012 at 07:18 AM. Reason: unfinished
    Thanks,

    Bud

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

    Default Ok,can some explain how to fix this

    So it works?
    Thanks,

    Bud

  3. #3
    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

    Ya, it works here, except for when you try to put Google in a frame. They no longer allow that. Nothing you can really do about it either, unless you want to use PHP to copy the page, remove whatever code is on it that makes it do that and then present that copy of the page in your frameset.

    Oh, and Google may have that blocked as well.
    - John
    ________________________

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

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

    Default

    I was afraid that it was not fixable.

    grrr

    oh well

    I was hoping a javascript work around was available.

    Thanks John
    Thanks,

    Bud

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
  •