|
-
Aug 10th, 2000, 08:53 AM
#1
Thread Starter
Lively Member
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?
-
Aug 10th, 2000, 05:20 PM
#2
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.
-
Aug 10th, 2000, 06:09 PM
#3
Thread Starter
Lively Member
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?
-
Aug 10th, 2000, 08:19 PM
#4
Monday Morning Lunatic
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
-
Aug 10th, 2000, 08:54 PM
#5
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.
-
Aug 13th, 2000, 04:40 AM
#6
Thread Starter
Lively Member
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]
-
Aug 13th, 2000, 09:04 AM
#7
Monday Morning Lunatic
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
-
Nov 22nd, 2001, 03:56 AM
#8
Lively Member
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
-
Nov 22nd, 2001, 09:26 AM
#9
PowerPoster
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;
-
Nov 22nd, 2001, 09:30 AM
#10
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|