Results 1 to 6 of 6

Thread: Possible problem with Google.js

  1. #1
    Join Date
    May 2008
    Posts
    10
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Smile Possible problem with Google.js

    I hope I'm posting in the right area of the forum (). Anyways, I'm having a small issue with a tiny bit of script that I just put into my site.


    I downloaded Google.js, and put the following code into the "head" section of my script.

    <script src="google.js">

    //Google Search Terms Highlighter- Cal Henderson (http://www.iamcal.com)
    //Script featured/ available at Dynamic Drive (http://www.dynamicdrive.com)

    </script>

    The problem is that now for some reason the page is lagging pretty bad. On top of that I'm getting an error, "The script on this page is taking too long to respond". I do have flash installed, but I didn't have any issues until I installed the Google.js scripting. Any ideas on why Google.js would cause lagging or script errors?

    I did get the script from DynamicDrive. Here is the link http://www.dynamicdrive.com/dynamici...ighlighter.htm


    All help is much appreciated.

    Diana

  2. #2
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    For it to work the way you have it defined in the <head> section, the google.js script has to be in the same directory as the file calling it. Are you sure it isn't in maybe /js/google.js or some other folder?

    Just wondering.

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

    MillerD08 (06-02-2008)

  4. #3
    Join Date
    May 2008
    Posts
    10
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    It's where it should be. I don't keep everything in folders because it confuses me. Is it best that I put it in a folder by itself?
    Last edited by MillerD08; 06-02-2008 at 10:26 PM. Reason: Additional Information

  5. #4
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Wait till you get a lot of files in the root -- THAT will confuse you!

    One thing I noticed is that this is how the guy spelled Google:

    Code:
    function highlight_goolge(term, container, color){
    but it was done consistently so should still work.

    Also, the filename is google.js, NOT Google.js.

    Other than that, I know zip about javascript. John will help you.... earth to John...
    Last edited by kuau; 06-02-2008 at 10:33 PM. Reason: added sentence

  6. The Following User Says Thank You to kuau For This Useful Post:

    MillerD08 (06-02-2008)

  7. #5
    Join Date
    May 2008
    Posts
    10
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by kuau View Post
    Wait till you get a lot of files in the root -- THAT will confuse you!

    One thing I noticed is that this is how the guy spelled Google:

    Code:
    function highlight_goolge(term, container, color){
    but it was done consistently so should still work. Other than that, I know zip about javascript. John will help you.... earth to John...

    You are so much help. I appreciate it. The script works like a charm. I did a search and pulled up my site. The script highlights the keywords as it should..it's the lagging, which causes Mozilla to stop responding temporarily. The error I'm getting I'm pretty sure is due to Mozilla not responding - it may have little to do with the script itself. Er. Um. Maybe lol


    Diana

  8. #6
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    IMHO putting all your javascript (and css, php, image) files in a separate folder is a good idea in general, but it doesn't usually affect the functioning. It is just good housekeeping. It makes it easier for you to find things, and therefore saves time and frustration, and is a kind thing to do for any programmers who may inherit your files at some point down the road.

    Glad you got it working. Ciao, e

  9. The Following User Says Thank You to kuau For This Useful Post:

    MillerD08 (06-02-2008)

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
  •