PDA

View Full Version : to load a Photogalery into a Div from external File



Salma82
11-05-2010, 08:59 AM
Hi!
I am using Dynamic Ajax Content to load an external page with text, pictures and photogalery(in Javascript) into a DIV. However, I am only able to load the text,pictures and not the photogalery. How can I solve this?

Thanks in advanse:-)

Beverleyh
11-05-2010, 10:24 AM
Please provide a link to the page - we need to see the gallery javascript to understand what the problem is.

Salma82
11-05-2010, 07:34 PM
Thanks Berverleyh!

I used the script underhttp://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
to load a text and a Photogallery into a div 'Content'

<li><a class="MenuBarItemSubmenu" href="javascript:ajaxpage('photo.html', 'Content');
loadobjs('simplegallery.js','jquery-1.2.6.pack.js','PhotoGalery.js')"> photo</a>
how can I expend the script under the Link above to make the photogallery work?

Beverleyh
11-05-2010, 07:42 PM
Need a link to your page - a working/non-working environment to see your setup.

molendijk
11-06-2010, 12:43 AM
A lazy method would be to use an iframe instead of Ajax, like this (replace Google and DynamicDrive with your external pages):

<head>

<style type="text/css">
.external {position:absolute;left:20%;width:70%;top:20%;height:70%;overflow:auto; border: 2px inset #dedede}
</style>

<script type="text/javascript">
included1 = '<div class="external"><iframe src="http://www.google.com" frameborder="0" style="width:100%; height: 100%"><\/iframe><\/div>' ;
included2 = '<div class="external"><iframe src="http://www.dynamicdrive.com" frameborder="0" style="width:100%; height: 100%"><\/iframe><\/div>' ;
</script>

<script type="text/javascript">
function remove(id)
{
while(document.getElementById(id).firstChild)
{document.getElementById(id).removeChild(document.getElementById(id).firstChild);}
}

function include(which,id){
var newdiv = document.createElement("div");
newdiv.innerHTML = which;

remove(id); document.getElementById(id).appendChild(newdiv);
}
</script>

</head>
<body >
<div id="gallery" ></div>

<a href="javascript: void(0)" onclick='include(included1,"gallery");'>load google</a><br>

<a href="javascript: void(0)" onclick='include(included2,"gallery");'>load dynamicdrive</a><br>

<a href="javascript: void(0)" onclick='remove("gallery")'>remove</a><br>

</body>
Arie Molendijk.