Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 03-29-2011, 01:44 PM   #1
New Member
 
Join Date: Jan 2011
Location: Stockholm
Posts: 13
Default Load content onClick?

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
robertnorgren is offline   Reply With Quote


Old 03-29-2011, 03:16 PM   #2
Gold Member
 
Join Date: Nov 2009
Location: New York
Posts: 370
Default

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.
__________________
Submit to my Website Gallery | NY Web Design
bcee is offline   Reply With Quote
Old 03-29-2011, 08:36 PM   #3
Gold Member
 
Join Date: Feb 2011
Location: Australia
Posts: 369
Default

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
__________________
Jason H.
DHDdirect.com
Domains - Hosting - Design

Last edited by DHDdirect; 03-29-2011 at 09:35 PM.
DHDdirect is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:06 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.