PDA

View Full Version : JavaScript catalog


Jhausman
12-20-2002, 10:53 PM
I am writing a script to be run off a CD. It is a online-catalog type script. I have a folder full of html pages, one for each book in the catalog. I need a method to parse, from the HTML the Title, Category, Author, ISBN, and Price from each of these pages to facilitate searching and the checkout basket. any help would be greatly appreciated.
Thanks

beetle
12-20-2002, 11:25 PM
How consistently formtted are all these pages? Are the data pieces you're after uniformly located throughout?

Javascript won't handle this task, BTW. PHP could, though.

Skyzyx
12-21-2002, 02:31 AM
Yeah, but can PHP be run off a CD? If it can, great, but I never seem to be able to run PHP files locally from my HD, so I'm not so sure.

I would suggest using XML. For each book (or whatever you're using), you can import the XML data into JavaScript variables in an HTML page, and search the variable strings for what you're looking for.

I've posted code to import XML into HTML here:
http://www.codingforums.com/showthread.php?s=&threadid=10603

beetle
12-21-2002, 03:56 AM
Ya, you couldn't run PHP from a CD. XML is a good idea though.

BTW, Skyzyx. I've taken your XML code and made it into an object. I'll be sure to show ya when I'm finished ;)

Skyzyx
12-21-2002, 06:21 AM
Sounds good. I'd like to see it!