Click to See Complete Forum and Search --> : Forced frames


stampman
07-20-2003, 08:02 AM
I have a website which is built on traditional HTML frames.

When searching a search word which I use in meta tags, in a search engine, some of my pages comes up alright, but the pages only - without the frame construction (!)

I wonder if someone out there know of any Java Script or so, which I can place in these pages, which in turn will FORCE any browser FIRST to load up the frame construction BEFORE loading up the page itself, in order to be shown correctly ?

I am not very 'advanced' in this, but I find it fascinating, though.

Many thanks in advance for any help!

Lotus
07-20-2003, 08:36 AM
Could we see your code?

stampman
07-20-2003, 09:00 AM
I got a reply from Charles. He gave me this code:

<script type="text/javascript">
<!--
if (self.location == top.location) {self.location.replace('frameset.html')}
// -->
</script>

I don't have a frameset.html file but I suppose I can use the index.html file instead, by using this the frameset comes up, but, of course, the right page the person clicked, will not show up.

Or do you have a better idea? I am not so advanced in this.

Mange hilsener til Bergen fra Gøteborg.

pyro
07-20-2003, 09:11 AM
These might help you force a frameset:

http://forums.webdeveloper.com/showthread.php?s=&threadid=2197#post10318 (javascript - won't work for 13% of your users)

http://forums.webdeveloper.com/showthread.php?s=&threadid=2111#post10273 (PHP -- needs some modefying)

stampman
07-20-2003, 10:07 AM
OKI
Let's say this:
I place the java script on all the pages in my site, so ensure they open with the frameset.

<script type="text/javascript">
<!--
if (self.location == top.location) {self.location.replace('index.html')}
// -->
</script>

Is there a way to force the frameset to open together with the required page?

What I mean is that if someone clicked on http://www.thesite.com/page5.html link, the
http://www.thesite.com/index.html
opens up instead of the desired page. Which was not desired...

Charles
07-20-2003, 11:37 AM
Create a new frameset just like the old one but with the new pages. Load this one.

pyro
07-20-2003, 12:44 PM
Did you look at the links I posted?

stampman
07-21-2003, 02:31 AM
Dear Charles
Wow now I understand why webmasters dislike to use frames, may be I have learn't a lesson here...

Dear Pyro
Yes I looked at the codes in the links you gave, I think these have to be modified no matter which one I use?...or can I use them as they are?

Dear wonderful people out there,
Thank you so very much for giving me so much attention, I am not very much advanced, but as I ask and get suggestions I learn more and more. I am now planning to redesign my entire site consisting of about 500 pages. When I started the project I started with frames since I thought that every single page would be smaller in bytes, in order to save bandwith.

Now I encounter this problem with the search engines. I thought if there was a way for me to save all that labour of redesigning each and every page.... that's why I turned to you.

Best wishes from Göteborg in Sweden.

stampman
07-21-2003, 02:46 AM
I have tried the little javacript snippet you gave me and it seems to function.
I wonder what would happen if I add a target="xxx" to this javascript? Have you tried such? May be this will fix the problem? Weird but possible?

I mean, in this case I wouldn't need to direct all to the index page instead of to the page desired by visitor, and still I wouldn't need to make a whole new frameset for each page???

If such a weird thing functions, that is!



Original:
<script type="text/javascript">
<!--
if (self.location == top.location) {self.location.replace('index.html')}
// -->
</script>


With target:
<script type="text/javascript">
<!--
if (self.location == top.location) {self.location.replace('page5.html' target="intro")}
// -->
</script>