Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: Pre Load Content Help
08-08-2013, 06:55 AM #1
- Join Date
- Jan 2013
- Thanked 0 Times in 0 Posts
Pre Load Content Help
I am would like to know how I would be able to achieve what I am after.
In one of my parent folders I add new sub folders in each sub folder has a has a html page with content and also a folder for images for that sub folder.
If new sub folder created in the houses folder I would like that to show up in housesforsale.html in list format showing image sample description etc. how would I achieve this?
example : listings
example : listings > /houses > /16 fake Street
08-08-2013, 03:10 PM #2
I know of no way for a client side script to read either a server or local computer directory with JS.
You could create an external .txt file to be read and acted upon by an AJAX load routine
or you could create a special JS file with an extension of .js that could be read by the html as it loads.
Users who have thanked jmrker for this post:
08-08-2013, 08:13 PM #3
- Join Date
- Jun 2007
- Thanked 569 Times in 550 Posts
also webDAV, common and available with apache and IIS, if enabled, can list and even grep the folders and files for you.
from a local computer, you can drag the folder into the browser in at least chrome, or rip up a zip file in any half-way recent browser.
to the OP:
That's all certainly doable, but you're getting into territory that a simple CMS or PHP framework, or dreamweaver templates, or maybe even old-fashioned SSI would be better suited to deliver. if you had a server build the list instead of the JS, you don't need to transfer over every html file to get the description, you can pluck it right into the list before shipping.
you can also do a half-way hybrid routine that uses the slow ajax routine outlined to build a new housesforsale.html page for you, that you then ftp up to the server. this essentially uses JS as a poor-man's server/dreamweaver renderer, but only you have to wait for all the files to be scanned, not your clients. the end result of a routine like that or dreamweaver will always vastly out-perform even the aforementioned server-side routine that scans the folders each time. cheap, simple, and fast, but only semi-auto...