|
|
#1 |
|
New Member
![]() Join Date: Jan 2011
Location: Stockholm
Posts: 13
|
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>
__________________
robertnorgren.com | photography |
|
|
|
|
|
#2 |
|
Gold Member
![]() Join Date: Nov 2009
Location: New York
Posts: 370
|
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.
|
|
|
|
|
|
#3 |
|
Gold Member
![]() Join Date: Feb 2011
Location: Australia
Posts: 369
|
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>
__________________
Jason H. DHDdirect.com Domains - Hosting - Design Last edited by DHDdirect; 03-29-2011 at 09:35 PM. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|