1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Anyone know how to solve this iframe problem?

Discussion in 'HTML & Website Design' started by reed265, Sep 22, 2013.

  1. #1
    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?
     
    reed265, Sep 22, 2013 IP
  2. competent123

    competent123 Notable Member

    Messages:
    1,743
    Likes Received:
    69
    Best Answers:
    6
    Trophy Points:
    255
    #2
    it would help if you show the site and the code you are using.

    Regards
     
    competent123, Sep 22, 2013 IP
  3. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #3
    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):
     
    reed265, Sep 22, 2013 IP
  4. competent123

    competent123 Notable Member

    Messages:
    1,743
    Likes Received:
    69
    Best Answers:
    6
    Trophy Points:
    255
    #4
    <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.
     
    competent123, Sep 22, 2013 IP
  5. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #5
    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.
     
    reed265, Sep 22, 2013 IP
  6. wiicker95

    wiicker95 Well-Known Member

    Messages:
    438
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    100
    #6
    Seriously?? IFRAME? Language attribute?? Is this a 1990 thread or what?
     
    wiicker95, Sep 22, 2013 IP
    matt_62 and ryan_uk like this.
  7. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #7
    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.
     
    reed265, Sep 22, 2013 IP
  8. competent123

    competent123 Notable Member

    Messages:
    1,743
    Likes Received:
    69
    Best Answers:
    6
    Trophy Points:
    255
    #8
    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.
     
    competent123, Sep 22, 2013 IP
  9. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #9
    unfortunately, your code won't work if we use chrome and IE, bro. because the iframe doesn't break at all.
     
    reed265, Sep 22, 2013 IP
  10. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #10
    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.
     
    deathshadow, Sep 22, 2013 IP
    matt_62 and ryan_uk like this.
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #11
    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.
     
    deathshadow, Sep 22, 2013 IP
  12. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #12
    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.
     
    reed265, Sep 22, 2013 IP
  13. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #13
    And how does that help your visitors running Firefox?
     
    kk5st, Sep 22, 2013 IP
    ryan_uk likes this.
  14. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #14
    somehow, if I put 50 iframes in my website, the visitors will be counted as 1x50 visitors.
     
    reed265, Sep 22, 2013 IP
  15. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #15
    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.
     
    deathshadow, Sep 22, 2013 IP
    matt_62 likes this.
  16. matt_62

    matt_62 Prominent Member

    Messages:
    1,827
    Likes Received:
    515
    Best Answers:
    14
    Trophy Points:
    350
    #16
    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.
     
    matt_62, Sep 22, 2013 IP
  17. reed265

    reed265 Member

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    Digital Goods:
    2
    #17
    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.
     
    reed265, Sep 23, 2013 IP