Hello guys, please help me, I try to put some iframe codes into my website and then try to load it. It is successfully done by chrome and internet explorer. Unfortunately, when I use firefox, one of the "sub domain" inside the iframes just pop out and there is no longer iframe in the firefox tab, instead, it redirects it the the site inside the iframes. My question is, do you guys have any code to put so that the iframes also work well in firefox?
I use my own vps to test drive this one, please don't bother if you don't want to visit, guys. http://15.185.95.210 here is the code I use <html> <body> <iframe src="http://siteA" width="360" height="200" scrolling="yes" sandbox="allow-forms allow-scripts"></iframe> <iframe src="http://siteB" width="360" height="200" scrolling="yes" sandbox="allow-forms allow-scripts"></iframe> </body> </html> Code (markup):
<script type="text/javascript" language="javascript"> <!-- if (top.location != self.location) { top.location = self.location.href } //--> </script> PHP: this code is forcing the site to take over the parent frame. you will find similar codes on facebook/msn etc. to solver this problem. create a dummy page in your site which the i frame . Then get an iframe in the dummy page which called for the site breaking out of the frames. It will break out of the first frame but not from the second frame ( it will display in your own iframe, what you intended) in other words, make an iframe within an iframe, and let site break out of the second sub iframe. frame breaker script will be executed only once. let us know if it works.
would you show me the complete script if you don't mind? I mean, please convert my code above with your codes so I can just add it to my hosting.
don't bother if you don't wanna answer, bro.... but if this work, I can get more than $1,000/ month, bro. that's why I ask.
index.php <html> <body> <iframe src="yoursite.com/file1.php" width="360" height="200" scrolling="yes" sandbox="allow-forms allow-scripts"></iframe> </body></html> PHP: code for file1.php <html> <body> <iframe src=" http://t.co/lp2ZUI6RRA " width="360" height="200" scrolling="yes" sandbox="allow-forms allow-scripts"></iframe> </body></html> PHP: t.co will break out of iframe in file1.php but it will then display in index.php iframe untested. on a side note best option, ignore.
unfortunately, your code won't work if we use chrome and IE, bro. because the iframe doesn't break at all.
I somewhat doubt that, though if so it's via some form of sleazy scam or preying on the ignorance of nubes, given that IFRAME was deprecated FIFTEEN YEARS AGO for a reason -- that reason being it's inaccessible trash, so whatever you are doing is also likely inaccessible trash. Have you tried using OBJECT instead? Could you AJAX the content instead, or are you playing some form of cross-domain trickery? OBJECT might be a good solution, since I believe it doesn't provide 'top' like IFRAME does... though again those types of games and tomfoolery really belongs in the '90's since again, it's most always an inaccessible broken wreck, defeating the entire point of building websites with HTML in the first place. Of course that the steaming pile of asshat bull known as HTML 5 brought it back and gave it another attribute just further proves that said 'specification' has been created to undo all the progress of the past decade and a half.
Just to show you how to use OBJECT for this: <!--[if IE]><object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="dummy.html" ><![endif]--> <!--[if !IE]>--><object type="text/html" data="dummy.html" ><!--<![endif]--> <p>Content to show when OBJECT not working</p> </object> Code (markup): I'm not 100% sure, but I believe OBJECT doesn't allow things to break out of them. Though again, I'd say if you're embedding another page that way, you're doing it all wrong.
thanks for all of you... I've been googling for these past hours and at last, I found this simple firefox extension. I use No script and nothing pop up from iframe again. thanks for all the answers, my friends. Your effort is really appreciated.
No, because cookies would be shared across domains, and the requests would all come from the same IP address and browser ID. There is NO reason to think all those iframes would be treated as anything but the SAME visitor just reloading the page over and over again. REALLY think you're not grasping how any of this stuff works.
somehow if you put 50 iframes on a site, it loads 50x slower. Dude, I just dont get what you are trying to do. A site with "awstats" *might* show up that visitors came (DONT quote me on this as I dont know if it will show up in awstats), but would it show up in GA? Just being presented with dozens of little iframes squares, slowly loading wont make people stay on your site for more then a few seconds.
well, Sir, the site similar to mine is supposed to deal with PTP or PP views. I don't intend it to use on GA. But I'll try this method whether it'll work on GA or not. @deathshadow thanks for the opinion, but my method is surely working with "certain" sites, Sir.