Content Display

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
ScrewyWabbit
Forum Newbie
Posts: 2
Joined: Mon Sep 05, 2005 5:36 am

Content Display

Post by ScrewyWabbit »

Hi All,

I have a problem Ive been trying to solve for a few days now, hopefully someone can help me out.

Here's my situation I have about 100 folders, each folder contains its own index.php page. Due to the fact a large number of folders are being used and folder content will be changed often I used php to display the dir to save constent hardcoding of links.

Now heres what I need to do:

When a disired folder is clicked I need the index page within the folder displayed in a DIV (yes it must be a div) Also the page must not refresh. The only way I saw to do it was using a hidden IFRAME and passing the vars to a DIV with JavaScript. I tryed a couple of the JS scripts floating around, The pages loaded into the DIV but all the php coding on the pages wasnt being recognized.

Any suggestions?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Sounds as though the XMLHttp Request/AJAX methodology may be of use. Have a look at this topic for a starting point or search on Google.
Fourtet
Forum Commoner
Posts: 29
Joined: Fri Sep 02, 2005 5:55 pm

Post by Fourtet »

Iframes can't parse php - it can only send and receive data from it - you have to use a callback function which takes the data received from the iframe after it's called the php file, then attach it to a parent div. It's very simple after you do it for the first time, it sounds like you've already got your system in place though so it could be a bit of a pain in the backside to migrate to the iframe method. You could use xmlhttprequest which would make things a bit easier but still, you'd have to do some modfications to your server side code and you lose ie users without active x enabled. Whatever happens you'll have fun, rpc is challenging but very rewarding. :)
ScrewyWabbit
Forum Newbie
Posts: 2
Joined: Mon Sep 05, 2005 5:36 am

[Solved] Content Display

Post by ScrewyWabbit »

Thanks for the suggestions, I think I have it licked now.
Post Reply