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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jakobu
Forum Newbie
Posts: 2
Joined: Tue Mar 08, 2011 11:55 am

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

Post 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
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

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

Post 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
Jakobu
Forum Newbie
Posts: 2
Joined: Tue Mar 08, 2011 11:55 am

Thank You!

Post 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
Post Reply