+ Reply to Thread
Results 1 to 6 of 6

Thread: Iframe filtering

  1. #1
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Iframe filtering

    How can I delete an div in an iFrame?

  2. #2
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Iframe filtering

    Not quite sure what you mean...?

    The iframe purely references another page and shows that content in the page with the iframe...

    If you have a div in your referenced page (the one the iframe is pointing to), you can delete divs in the same way as any other page???

    It can't be this simple...

  3. #3
    galaxyAbstractor's Avatar
    galaxyAbstractor is offline Community Advocate galaxyAbstractor is on a distinguished road
    Join Date
    Oct 2007
    Location
    Land of Null and Insanity
    Posts
    5,495

    Re: Iframe filtering

    Say that I want to iframe this forum for an example, but I don't want the header or sidebar, just the posts, would there be a way to filter out the header and sidebar, with like javascript?

  4. #4
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Iframe filtering

    Ooohh.. I get you...

    I'm not sure there is any way to do this, unless there is a way to load the page as a string or array first - but even then, you need to know exactly what the position is of the divs, which may change depending on the parsing output.

    Tricky..

    Unless the forum outputs an rss feed, which can be easily accessed.

  5. #5
    mephis's Avatar
    mephis is offline x10Hosting Member mephis is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    39

    Re: Iframe filtering

    I had a similar problem this week...
    I decided the best way was to cURL the iframe page, store the html in a variable and just parse it to remove/retrieve the bits of HTML before putting them on my page (I did it through AJAX, but I'm sure you don't necessarily have to)
    Although I'm sure you can access the contents of the iframe through javascript and remove the offending div(s)

  6. #6
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: Iframe filtering

    Quote Originally Posted by mephis View Post
    ... to remove/retrieve the bits of HTML before putting them on my page...
    But if the page is dynamic, with changing content, how do you know how to set the string position to delete the divs at those points?

    Unless you do a str_replace, but this will change code arbitrarily and not necessarily the bits you want it to.

    I suppose this isn't such a problem with div id's, rather than classes.

+ Reply to Thread

Similar Threads

  1. iframe Troubles
    By 104lbofinsanity in forum Programming Help
    Replies: 4
    Last Post: 09-20-2008, 09:55 AM
  2. iframe javascript problem
    By oracle in forum Programming Help
    Replies: 5
    Last Post: 06-29-2008, 12:56 PM
  3. Passing vars from parent to iframe
    By gottaloveit in forum Programming Help
    Replies: 8
    Last Post: 05-07-2008, 11:15 AM
  4. just how smart can an iframe get?
    By bonzo meier in forum Programming Help
    Replies: 4
    Last Post: 03-05-2008, 10:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers