Page 1 of 1

Include if (??display:"block"??) is true

Posted: Tue Mar 08, 2011 12:06 pm
by Jakobu
Hi,

I have an for me tricky situation. I have a fairly large file that is positioned inside a div that is hidden by css due to display: "none". Then I have a javascript that changes display: "none" to display:"block". The javascript is working fine, but I would like this large page to only load when somebody clicks to execute the the javascript and makes the nested1 div visible.

I like to include another page only when the CSS item #nested1 have display: "block"; and not if it has the value display: "none";

Is ther a way to let a PHP script get the display information from the item #nested1 in the css file and only include LargePage.php when the value is set to block.

<div id="nested1"> </div>
<?php
:? here we like to extract som data from #nested1 located in iBoxar.CSS : :?
if (condition )
include('LargePage.php'); ?>
</div>


An bonus would be to ad an else if, that includes the large page if everyting else is loaded.

Many thanks

Jakob

Re: Include if (??display:"block"??) is true

Posted: Tue Mar 08, 2011 6:53 pm
by Weiry
Problem with this, is that PHP is a SERVER SIDE languange.

All code is processed by PHP before the page is even rendered. You cant change that half way through.

Having said that, you could use AJAX to essentially load an external php page once the ajax conditions have been met.
I know nothing about AJAX, so here is a google search for loading content :)

ajax load external php page

Thank You!

Posted: Tue Mar 08, 2011 9:14 pm
by Jakobu
Thank you!

Im on the AJAX,

Works great !!

found this tutorial and it Rocks!!
http://www.dhtmlgoodies.com/index.html? ... jax-basics

Thanks for pushing me in the right direction.

Jakob

Im still a Newbie in the web designing and I am still on to prototyping this on another page in the background, but within a few days I hope to have a realy smooth include and loding on my page.
http://ooodesignlab.com