Results 1 to 4 of 4

Thread: Need addtional help loading external HTML into DIV

  1. #1
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need addtional help loading external HTML into DIV

    My sister is a graphics communication major in NYC and in need of a portfolio page so she can pay her bills. Her request to me was a page that acted as an image gallery showing off her different projects. You can view my working-files at http://www.czyk-design.com to get a better idea of my troubles..

    When the page initially loads I use (DynamicDrive's) AJAX script to load an external HTML (BSPR.html) into the #panel container and also load the javascripts that enable the jquery image fading gallery. Now, the Project 1 link is a link to the exact same page but as you can see when it loads the jquery doesn't seem to take affect.

    Ive also read AJAX isn't necessarily a good route for loading external content into a website so if anyone here has a better suggestion for implementation that would be great! I was hoping there was a jquery app that would allow me to do this all on one page but had trouble accomplishing this.

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,879
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    I don't know exactly what you want, but the following may be of help.
    If you put this script in the head:
    Code:
    <script type="text/javascript">
    function create_external(the_id,url,object_style)
    {
    var inserted=document.getElementById(the_id);
    if(/*@cc_on!@*/false)
    {
    inserted.innerHTML='<iframe src="' + url + '", style="'+ object_style +'"><\/iframe>'
    }
    else
    {
    inserted.innerHTML='<object type="text/html" data="' + url + '", style="'+ object_style +'"><\/object>'
    }
    }
    </script>
    and this div in the body:
    Code:
    <div id="some_id" style="display:inline"></div>
    then you can have any external content in the div with:
    href="#" onclick="create_external('some_id','some_file.html', 'position:absolute; width:190px; height:250px; background-color:yellow; left:0px; border:1px solid red;margin-top:9px'); return false; " (the styles are just illustrations).
    ===
    Arie Molendijk.

  3. #3
    Join Date
    Jun 2009
    Location
    California, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re : Need addtional help loading external HTML into DIV

    When HTML loading into DIV few major problem is there and also AJAx's full time not support.

  4. #4
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    suggest you use PHP include

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •