views:

29

answers:

2

I play some of the games on facebook and I was wondering if there is a way for me to create a simple HTML file with the game in an IFRAME. Ive been tinkering with it and can't seem to get it to display correctly and facebook breaks out of the frame after a bit.

A: 

You probably can't. In the end, there is nothing that can stop Facebook (or any site for that matter) from putting this in the top of a JavaScript file that is used on the page:

if (top!=self) {
    top.location.replace(document.location);
}

As a matter of fact, that's exactly what StackOverflow does to prevent it's content from being presented in an IFRAME element.

Also, it's very likely that you are violating some sort of Terms of Service, a license, or something of that nature by trying to do that.

casperOne
A: 

Ok. I appreciate your answer. Now that I think about it that would create some problems for them since that would be cutting out the advertising and such. I was just going to use it locally as a sort of customized game page, so I could put a regular chat box on the page too, for my dad and me. Oh well. Yahoo messenger it is.

Thanks again, Jared

Jared