Your Ad Here

Sponsor Advertisement
Writing Community
community for fiction writing, story writing, poetry writing, writing contests, writing help, writing warnings
Blogging Fusion Blog Directory
Submit your blog to Blogging Fusion Blog Directory for FREE. Start increasing your backlinks and traffic today!

How to break out of Frames or Someone Else's Frames?


Post new topic   Reply to topic  Invision-Graphics Forum Index –» Programming –» Print Topic
View previous topic –» View next topic
Level 1 User

martyk9
Level 1 User
Occupation: Freelance Webmaster
Location: Jersey
usa.gif

Offline
Joined: Jul 15, 2006
Find all post by martyk9
Total Posts: 5
0.01 posts per day
Total Words: 651
PostPosted: Sun Feb 03, 2008 6:48 pm  Post subject: How to break out of Frames or Someone Else's Frames?
I hope this is in the right thread, I have a problem with a web site using frames to pull my site and content to load within their website. Their using some sort of Frames to load my content within their website without my permission.

I tried searching but couldn't find a solution that works to fix my problem, any help would be appreciated...

Marty Uh Ohh
Reply with quote
View user's profile Send private message
Back to top
Sponsor Advertising
Site Admin

Admin
Site Admin
Occupation: Web Developer
Location: Canada
blank.gif

Offline
Joined: Nov 26, 2004
Find all post by Admin
Total Posts: 79
0.06 posts per day
Total Words: 26,399
PostPosted: Sun Feb 03, 2008 7:07 pm  Post subject: Re: How to break out of Frames or Someone Else's Frames?
Hello Marty Smile

This can be annoying but there is an easy solution to get around it. You can use JavaScript within your web pages to break out of Frames.

This is how...JavaScript Method, Now be sure to place it between the <HEAD> tags </HEAD> of your web page ...

Code:

<script language="JavaScript">
<!-- Breaks users out of frames. Put this under the body tag -->
<!-- Hide script from older browsers
setTimeout ("changePage()", 3000);

function changePage() {
if (self.parent.frames.length != 0)
self.parent.location="http://yourpage.com";
}
// end hiding contents -->

</script>



The best method that I would suggest is to use the following.

Step 1. Open notepad up and paste the following in

Code:

function breakout_frame()
{
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}



Step 2. Close notepad and save it as breakout.js

Step 3. Upload the breakout.js file to your root directory of your website.

Step 4. Include the JS script within your website by using the following

Code:

<script src="breakout.js" language="JavaScript" type="text/javascript">
</script>


It should be placed in the <head> section of your web page..

Step 5. Place the function breakout_frame() in the <body> tag like so, by replacing <body> with the following body tag....

Code:
<body onload="breakout_frame()">


This will load the JavaScript JS file on each page load, so if your web pages are loading inside someone else's frames it will force the page to break out of frames.

There is also a None JavaScript Method: Use a Meta Tag that the user can click to break out of the other sites frames by using the following..

Code:
<META HTTP-EQUIV="Window-target" CONTENT="_top">Break out of a frame</a>


Hope this helps and report back if you need any further help!

Shawn DesRochers Smile


Forum Signature
Affordable Web Hosting | Ultra Game Play
Reply with quote
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Back to top
Level 1 User

martyk9
Level 1 User
Occupation: Freelance Webmaster
Location: Jersey
usa.gif

Offline
Joined: Jul 15, 2006
Find all post by martyk9
Total Posts: 5
0.01 posts per day
Total Words: 651
PostPosted: Mon Feb 04, 2008 5:56 pm  Post subject: Re: How to break out of Frames or Someone Else's Frames?
Shawn you are awesome...my friend.

Your second option is the one I went with and it did the trick, works great!

Thanks for all your help.

Marty Big Smile Shocked
Reply with quote
View user's profile Send private message
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Invision-Graphics Forum Index -> Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
 
Free Advertising | Loans | Cheap Moissanite Earrings | Cheap Car Insurance | Hotel Las Vegas
Click Here to Advertise
Affordable Hosting! http://www.invision-graphics.com/images/banners/468X60_VISIONHOSTING.gif
 Today: 29,848  Yesterday: 33,449  Total Hits: 23,036,204
Page Rendered in: 0.17s - Total Queries: 8 - MySQL DB: 15.2 mb's - Pages served in past 5 minutes: 147