PDA

View Full Version : Need addtional help loading external HTML into DIV



kubakuba
06-07-2009, 10:11 PM
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.

molendijk
06-07-2009, 11:36 PM
I don't know exactly what you want, but the following may be of help.
If you put this script in the head:
<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:
<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.

opoll602
06-08-2009, 05:33 AM
When HTML loading into DIV few major problem is there and also AJAx's full time not support.

vwphillips
06-08-2009, 12:39 PM
suggest you use PHP include