Load content onClick?

robertnorgren

New Member
Hi!

Here's a (perhaps) tricky question for you.

I'm looking for a way to force the browser to load a php-included site only when a certain link is clicked.

Page affected: http://www.twistmagazine.se/gallery/2011/archive

As you may see, as time goes by, the entries multiply. Therefore loading time of the entire page escalates. I'd like to optimize the performance of the page but still keep the structure of the gallery.


Hope you can help me with some ideas. Here's the code snippet:


Code:
<div id="newgallery">
<div id="gallerytitle"><div id="dhtmlgoodies_control">
<a href="#" onClick="slidedown_showHide('box4');return false;">Link to produce dropdown box</a>
</div></div>
<div class="dhtmlgoodies_contentBox" id="box4"><div class="dhtmlgoodies_content" id="subBox4">

***The content I want to be loaded when link inside div.gallerytitle is clicked.
This content is a bunch of photos, and is shown inside a dropdown box***

</div></div></div>
 

bcee

New Member
You could output the content as JSON or XML and parse it with javascript then load it dynamically. It would be easier to do using jQuery (or another JS framework) since it has built it functions for AJAX.
 

DHDdirect

New Member
You'll have to also force a page reload since php is server side. So the link actually opens up the same page but with a variable in appended to it that says to open up the include

Code:
<?php
if ($_get['include'] == 'yes') {
include ("includedfile.php");
}
?>
 
<a href="http://thispagesurl/thisfile?include=yes">Show Include</a>

** I'm going to stop answering questions at 5am :) I've rewrote this whole thing from my original post
 
Last edited:
Top