Script for Framed Sites?

All web design questions, hints and solutions can be discussed here.

Moderators: fac51, 117, Chris

Post Reply
User avatar
fac51
Gaming Guru
Posts: 14526
Joined: Sat Jun 14, 2003 11:00 am
Location: Rapture
Contact:

Script for Framed Sites?

Post by fac51 »

If i do a search on google and see a page of my site when i click on the link it takes it to that page but without the frames (as this is main page only) therefore vistors cannot see the index on the left and therefore cannot navigate back to the main page! :o
Last edited by fac51 on Fri Jul 18, 2003 4:18 pm, edited 1 time in total.
Image
User avatar
Adamizer
Film Guru
Posts: 379
Joined: Sat Jun 14, 2003 9:10 pm
Location: Gothenburg Sweden

Post by Adamizer »

Then make a button for the frame in the forum. Ive been meaning to ask u for one but forgot it every time I was done looking there....
arsehole
Herb Guru
Posts: 15
Joined: Wed Jun 25, 2003 6:29 pm

Post by arsehole »

you could use a javascript tht redirects the visitor to the frameset page if its not in a frame...
paste this script in the head of each individual page
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (window == top) top.location.href = "index.htm";
// End -->
</script>
Opinions are like arseholes, everyone has one.
User avatar
fac51
Gaming Guru
Posts: 14526
Joined: Sat Jun 14, 2003 11:00 am
Location: Rapture
Contact:

Post by fac51 »

ahh rite :) does it only redirect if a visitor hits a link to an unframed page ie. on google but wont act if they go to the same link from the frame page?
Image
arsehole
Herb Guru
Posts: 15
Joined: Wed Jun 25, 2003 6:29 pm

Post by arsehole »

exactly :)
its a simple if statement tht checks if the url of the page is the same as the url on the address bar...
if it is, it'll then redirect the user to the main frame page (make sure u dont put the script there :lol:)
you could search around for a more specific script tht redirects the user to the main frame page with the page he wants in the frame
Opinions are like arseholes, everyone has one.
User avatar
fac51
Gaming Guru
Posts: 14526
Joined: Sat Jun 14, 2003 11:00 am
Location: Rapture
Contact:

Post by fac51 »

cheers m8.. i'll give it a whirl :0
Image
User avatar
fac51
Gaming Guru
Posts: 14526
Joined: Sat Jun 14, 2003 11:00 am
Location: Rapture
Contact:

Post by fac51 »

thanks ive added the script to all pages and it works a treat :mrgreen:
Image
Post Reply