View Full Version : Dynamically build HTML table from external file......
quinnrd
01-23-2003, 01:58 PM
I need to be able to build a table on the fly from
an external file when a user clicks on a link. I want to display an image along with a description (some Text). Is anyone aware if a script exists that will do this for me. Thanks in advance.
codefox
01-23-2003, 02:59 PM
That could be done using server-side scripting. BTW, what do you have in the file and where do you want to get the image from?
quinnrd
01-23-2003, 03:27 PM
At least for now server side is not an option since I do not have access to one. I have seen this done with DHTML and figured that perhaps it could be done in javascript. The jpg or gif files
would reside locally on my harddrive.
The external file would look something like this:
path to someJPG.jpg ,path to Description of this JPG.
result:
------
- This is a description of this JPG.
JPG -
-
------
Thanks for the reply....
Danne
01-23-2003, 05:02 PM
If you want to create tables on clientside, you may find some help here:
http://www.w3schools.com/dhtml/dhtml_dom_table.asp
I'm not sure if these methods are supported in Netscape though...
Vladdy
01-23-2003, 05:27 PM
See my implementation: www.vladdy.net/webdesign/DOM_Tables.html
Remember, though, that since client-side can not read files, your data has to be presented in the form of javascript array...
... if your file is in the same domain you may be able to load it in an IFRAME and parse it's innerHTML, but that will be a pain. Server side is the best option anyway, get yourself a real host.
whammy
01-23-2003, 11:50 PM
I agree with Vladdy - this type of thing is very easily done in PHP, ASP, etc.
I personally would use ASP with a database. A good beginner tutorial is right here (http://hotwired.lycos.com/webmonkey/02/35/index4a.html?tw=backend)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.