Zen Cart Logo
Forums / General Questions / My site gets stuck in someone else's frame...

My site gets stuck in someone else's frame...

Locked

Views: 1,261

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
14 Nov 2007, 8:10 PM
#1
kayla avatar

kayla

Zen Follower

Join Date:
Mar 2005
Posts:
186
Plugin Contributions:
0

My site gets stuck in someone else's frame...

... from my biggest referrer. Can one of you wizards tell me what is the best method to get them out and where do I put it?

If I do the javascript code to automatically break them out where do I put it? I haven't done any custom java on my sites with Zen and I don't know how to do it. Do I put it in the header.php doc?

I also have the manual "click here" html on my home page but people don't always see or do it and when they go to check out they are getting taken to a bogus payment page in Paypal because it's not referring properly if they are still stuck in the frame so I'm wondering if I need to put breakout code places other than the home page or if an auto script will do the trick for the entire site.

Thanks much!

:smile:

15 Nov 2007, 1:00 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: My site gets stuck in someone else's frame...

If your site is in a frame on another site, that's because that site owner want to put in there. I don't think you can/or should try break out. The only way is to contact that person, see if he/she can help

15 Nov 2007, 3:37 PM
#3
kayla avatar

kayla

Zen Follower

Join Date:
Mar 2005
Posts:
186
Plugin Contributions:
0

Re: My site gets stuck in someone else's frame...

Thanks but that's totally not true. It's a somewhat common thing with newer browsers and older sites built entirely based on frames. Any URL they refer inside their main frameset that they don't put a "target_blank" ref makes the site/page open still inside their main frame.

There is common code out there to break it out and what I am essentially asking is how and where do I put the code/script. The script I found is Java but there is an asp one also, and even though I didn't find it I thought maybe there might be a php script that would work since ZC is php-based.

language="JavaScript" 
<!-- if(parent.frames.length>=1 {
 window.top.location.href="index.html" 
} // --></script>

:thumbsup:

15 Nov 2007, 4:08 PM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: My site gets stuck in someone else's frame...

It's hard to see what you really want without a link. However, you seem to be confused, Javascript is NOT Java (the code you posted there is Javascript).

I never use frame. But, assuming that I put your site on a frame on my site, I don't want you to do anything to break the frame (since it can break my design). As the result I will completely remove your site from my site.

15 Nov 2007, 4:29 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: My site gets stuck in someone else's frame...

You could try replacing "index.html" with "index.php" in your javascript. But that would only send you to the home page of your site, since it doesn't deal with any URL parameters.

As to "where" to put it ... http://www.zen-cart.com/wiki/index.php/Customisation_-_Templates_-_Javascript

15 Nov 2007, 9:39 PM
#6
kayla avatar

kayla

Zen Follower

Join Date:
Mar 2005
Posts:
186
Plugin Contributions:
0

Re: My site gets stuck in someone else's frame...

Thanks Doc. Every script I have found says to just put the script between the head tags of the html in the top of the index page. Here's another example. It doesn't appear to require making a .js doc.

The JavaScript code
The script is very simple - Just write this between <head> and </head> :

<script language= "JavaScript"> <!--Break out of frames if (top.frames.length!=0) top.location=self.document.location; //--> </script>

Can you tell me how to do that in relation to ZC since it's all in php? I'm not a php programmer so I don't understand where to find the html of the document head.

15 Nov 2007, 9:45 PM
#7
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: My site gets stuck in someone else's frame...

put it in /includes/templates/YOUR TEMPLATE/common/html_header.php

15 Nov 2007, 10:09 PM
#8
kayla avatar

kayla

Zen Follower

Join Date:
Mar 2005
Posts:
186
Plugin Contributions:
0

Re: My site gets stuck in someone else's frame...

Thanks Merlin: I figured that out while you were posting! At first I didn't put it in my template folder so it wasn't overriding.

It seems to work now in Firefox but not in Opera. I know that's way beyond anything to do with ZC but if anybody has any ideas/suggestions as to why that would be happening that would be cool!

Thanks for all your help!

If anyone wants to test the situation, the referring site is:

http://www.laurerupc.com

Because it's done in frames you have to click on the second link "Need Only One Barcode?" and then the next page there's a list of sites and my site is the first one: http://www.ezupc.info

If the java thing is working, when you click on my site you'll see my site's url in the browser bar, but if not, it will still say laurerupc.com even though it shows all my site and if you view source you'll see the code from his frame.

:cool:

16 Nov 2007, 5:00 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: My site gets stuck in someone else's frame...

Kayla:

Thanks Doc. Every script I have found says to just put the script between the head tags of the html in the top of the index page.That's exactly what making a .js file does automatically for you, and exactly why I suggested it.

Zen Cart loads the jscript_xxxx.js files from the jscript folder and inserts them automatically in the middle of processing the html_header.php script. The FAQ explains what to do, and some of how it works.

If you use this method, then your "plugin .js file" is a simple drop-it-in-and-it-works sort of thing, and you won't have to worry about editing the html_header.php file during your next site upgrade.

16 Apr 2009, 4:30 PM
#10
graffi avatar

graffi

New Zenner

Join Date:
Jul 2006
Posts:
21
Plugin Contributions:
0

Re: My site gets stuck in someone else's frame...

update for this: my site is linked from about.com, and they add a frame, which (as mentioned above) craps out the Paypal payment page.

Adding the script jscript_noframes.js to the

**includes/templates/{template name}/jscript **

&

**includes/templates/{template name}/jscript/on_load **

directories did the trick.

Copy / paste the following into notepad, and save it as "jscript_noframes.js" and upload to the directories above:

if (top.frames.length!=0)
top.location=self.document.location;

Thanks for the tip (this was driving me crazy & probably costing more than a few sales). Hope this helps someone else...