Results 1 to 10 of 10

Thread: More frames questions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123
    1. Is it possible to run a javascript function defined in one frame from another frame?

    2. I have heard a few arguments both for and against using frames. What do you think?

  2. #2
    Guest
    I dont think it is possible to use a JS function from another frame, but you can use a *.js file... I am not sure how though....

    and if you need the TOC of your page to be visible all the time, its easier to use frames then other things, like including it on every page.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123
    That is exactly the reason that I am experimenting with frames - I have a header, and a TOC down the left hand side and both are identical on all pages. Using frames eliminates the need to replicate the header and TOC code in all of the pages (but you know that already - I am still on the learning curve!!!)

    I believe that a frames site can cause problems when it comes to the search engines. If a search engine lists one of the "child" pages and you click on that link, then all you see is that particular frame. Any thoughts on how we get around this problem?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use a 'frames breaker' code. Basically, check if this frame = window.top, and if it is, reload window.top as the index frame. Microsoft's MSDN library frames system is quite complex but works well, and I would suggest you dissect their code.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Guest
    you could use a certain meta tag,
    I am not sure what it is called or how to use it, but there is one metatag that excludes the page from search engines.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 1999
    Location
    Leicester, UK
    Posts
    123
    Dennis: I think you are referring to <META name="ROBOTS" content="NOINDEX, NOFOLLOW">. I am already using this in a couple of pages in my site. One of them is a customised 404-Missing Link page (I don't like to advertise my errors!!!), and the other is the redirect page following submission of a form - I don't want anyone starting off from there.

    However, I would like all of the other pages to have a sporting chance with the search engines.

    Parksie: Could you expand a bit on your frames breaker code? What is the code to check the current frame id? Perhaps an example? Thanks in advance.

    [Edited by Michael on 08-13-2000 at 05:42 AM]

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Put this in the <head> section of your page:
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    if (window != top) top.location.href = location.href;
    -->
    </SCRIPT>
    What this does, is if this is a sub-frame page, it breaks out and moves to the top. Therefore, if you replace the last location.href with the page you want, then it will move to the index.

    As for checking the frame id, use window.name (I think).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8
    Lively Member Base's Avatar
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    65
    But what if I want the page to beloaded in my frames and NOT a new window of how the sites belong to.
    He uses the top.location.href != top to test this. Is there some way of by passing this check?

    Thanks
    Ok

  9. #9
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    Arrow hi

    First of all it is possible to call a function of one frame from another.

    it works in IE (dont know about netscape)

    something like this:
    Code:
    top.framename.functionname;

  10. #10
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    that code should work in NS also

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

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



Click Here to Expand Forum to Full Width