WEB question about div's

Discussion in 'OT Technology' started by jizzmo, Sep 26, 2008.

  1. jizzmo

    jizzmo New Member

    Joined:
    Jul 9, 2008
    Messages:
    1,336
    Likes Received:
    0
    So is it possible to load an HTML document inside of a div?

    Say page 1 has these div's menu, header, content, and when you click on a link within the menu the HTML page referenced is loaded in the content div. Possible? or is there a different way to do it?
     
  2. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    I know changing divs with your own page content requires ajax ... this is probably what you need.
     
  3. catpiss

    catpiss Guest

    You can also do it the old school way by targeting a 1pixel frame that has javascript to control elements on it's parent.
    innerHTML

    You will probably want to make sure the pages you load dont affect your page's javascript/css.

    Alternatively, you may have better luck putting an iframe within a DIV.
     
  4. jizzmo

    jizzmo New Member

    Joined:
    Jul 9, 2008
    Messages:
    1,336
    Likes Received:
    0
    iframes look unprofessional and ugly. still looking for an answer will post if i find one.
     
  5. jizzmo

    jizzmo New Member

    Joined:
    Jul 9, 2008
    Messages:
    1,336
    Likes Received:
    0
  6. jizzmo

    jizzmo New Member

    Joined:
    Jul 9, 2008
    Messages:
    1,336
    Likes Received:
    0
    IBkingtoadSaysDrupal
     
  7. catpiss

    catpiss Guest

    If you size and style the iframe well, nobody will even notice. I wouldn't call it unprofessional and ugly. The only reason I recommend the iframe vs something else is that you didnt mention what you were putting into the div. If it is random sites, then an iframe would be the least problematic as their scripts/styles... would have less effect on the rendering of your page.

    If you are displaying code that you control, then the iframe argument doesn't matter.

    As far as word documents go Office automation may end up opening doors for viruses on your web server, especially if others have the ability to upload the word documents.
     
  8. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    yeah, you just use javascript
     
  9. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    http://brahma.cs.gsu.edu/~legend6/

    click on the menu items. all they are doing is loading an external HTML file into the main content div. You don't really want to do it the way we did it for menu links, though, cause you prevent the user from having any sort of breadcrumbs.
     
  10. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    Are you talking about HTML fragments or full HTML files?

    Loading HTML fragments into a div would be fine but I'd shy away from loading an entire HTML document (with doctype, head, body etc) into a div, and go the iframe route.
     
  11. jizzmo

    jizzmo New Member

    Joined:
    Jul 9, 2008
    Messages:
    1,336
    Likes Received:
    0
    Thanks a ton, after some research it looks possible.

    Already decided against iframes.. they are so 1990:mamoru: and I am going to have 100 + pages linked with different heights. so iframe is out of the question.
     
  12. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,919
    Likes Received:
    10
    Location:
    Los Angeles
    :rofl:

    :love:

    But, really. You can probably load a node into a panel using AJAX in Drupal. :mamoru:
     
  13. jizzmo

    jizzmo New Member

    Joined:
    Jul 9, 2008
    Messages:
    1,336
    Likes Received:
    0
    i know, i know. i Am going to sart playing with drupal more on my next website idea.
     

Share This Page