SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist Fourth Doctor's Avatar
    Join Date
    Feb 2003
    Location
    Surabaya
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Keep Google Out Of My Javascript

    Code:
    <script language="javascript" type="text/javascript">
    // frameJammer_hp v3.2.2
    if (window.name!='mainFrame' && window.name!='booker_'
    		 && !((self.innerHeight == 0) && (self.innerWidth == 0)))
    		top.location.replace('../index.html?some-folder/some-file.htm~mainFrame');
    // frameJammer_hp End
    </script>
    Any ideas how I can hide this script from search engine robots or stop them from calling it up?

    Google's Media Partners bot consistently tries to pull the page "some-file.htm" as above, for example, like this:

    GET /?some-folder/some-file.htm~mainFrame HTTP/1.0" 200 14437

    So it just keeps seeing "index.html" when actually it is trying to pull "some-file.htm". 14437 kb's is the size of "index.html".

    Thanks.

  2. #2
    SitePoint Zealot simplyunique's Avatar
    Join Date
    Jun 2003
    Location
    Montreal
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is your frameset like? I can give you another frame stuffer if you want.. one thats less complex
    Fonkuscious say: Sink a foot in into my code and stub your toe

  3. #3
    SitePoint Evangelist Fourth Doctor's Avatar
    Join Date
    Feb 2003
    Location
    Surabaya
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a three frame single frameset, nothing out of the ordinary. I've seen other scripts, not sure they are as effective as this one though.

  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wasn't aware that Google (et al) even read javascript, let alone parsed it (yet).

    Have you tried placing the script in an external js file and simply calling it at the appropriate point in your markup via the function name?
    Whilst they might index urls that appear in the markup, they are possibly less likely to open and index the contents of linked js files.

    ---

    Of course, the best solution would probably be to avoid using frames in the first place.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  5. #5
    SitePoint Evangelist Fourth Doctor's Avatar
    Join Date
    Feb 2003
    Location
    Surabaya
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    I wasn't aware that Google (et al) even read javascript, let alone parsed it (yet).
    The trend is towards them following js links but this one is new to me. The main Google crawlers generally ignore this js. MediaPartners is clearly a different beast.

    Have you tried placing the script in an external js file and simply calling it at the appropriate point in your markup via the function name?
    Whilst they might index urls that appear in the markup, they are possibly less likely to open and index the contents of linked js files.
    Then every single page needs its own javascript file, doesn't it? That's about 850 individual js files. Big pain.

  6. #6
    SitePoint Guru quenting's Avatar
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    735
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can't you check the useragent in your server side script and not generate the javascript for the bots you want ?

    Quentin
    The largest message boards on the web !
    unblog.fr, hosting 700000 french blogs

  7. #7
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Fourth Doctor
    Then every single page needs its own javascript file, doesn't it? That's about 850 individual js files. Big pain.
    If I understand your needs correctly then it should be no problem to use a generic script and using a generic reference to the referer to correctly reconstitute the frameset.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  8. #8
    SitePoint Evangelist Fourth Doctor's Avatar
    Join Date
    Feb 2003
    Location
    Surabaya
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by quenting
    can't you check the useragent in your server side script and not generate the javascript for the bots you want ?
    Quentin
    I am afraid this all over my head. I just put the code on the pages. Hard coded, there is no server side script as far as I know. As I said over my head.

    How would I go about putting in a script to do this?

    Quote Originally Posted by Bill Posters
    If I understand your needs correctly then it should be no problem to use a generic script and using a generic reference to the referer to correctly reconstitute the frameset.
    Not really sure here either. Each bit of the code is page specific, it must include the url of the page it is working on/in.


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
  •