HTTrack Website Copier
Free software offline browser - FORUM
Subject: Two things concerning javascript
Author: GreyWyvern
Date: 04/26/2004 19:20
 
I'm currently using HTTrack to make on offline copy of our 
website and first of all, thanks for fixing the src= bug in 
3.32!

Anyway, there are two other problems I have concerning 
HTTrack and javascript files.

1) We have a page for downloading firmware updates for our 
products.  This list is populated by links coming from a 
javascript array.  I do this so it can still be searched 
offline.  The javascript file that the page includes in one 
directory below the html page, while the actual firmware is 
in another directory.  The setup is like this:

/download.html
/inc/download.js
/firmware/[various .zip files]

The trouble is, that in the javascript arrays, all I give is 
the filename (eg. product1.zip) and in writing the search 
results to the screen, the path "/firmware/" is added.

When the javascript is included in the html file, all of the 
links point to the right directory.  However, HTTrack takes 
the filenames in the array as literal file locations and 
looks for them in the same directory as download.html  This 
results in hundreds of "Not Found" files showing up in the 
root directory.

I know to fix this would mean HTTrack would have to parse 
javascript, but would there be a way to cancel javascript 
manipulation for only certain files?  I can easily modify 
the .js file myself, but deleting hundreds of non-files from 
the root directory is annoying.

2. In a similar vein, but probably much more easily fixed: 
On many of the pages of the website I have a "jump menu" (a 
drop down which jumps to a new page on select).  In order to 
keep it from becoming a "dead" screen object if javascript 
is disabled, I write it to the screen using document.write() 
commands.  A typical option tag would look like this:

document.write("<option value=\"../products.
php\">Products</option>");

The trouble here is that, because of the escaped quotes (I 
assume) HTTrack isn't recognizing these as actual URIs and 
is not changing the .php extension.  This means I have to do 
a multi-file search and replace before the jump menu's point 
at the right files.


There are a couple more little things, but none as 
troublesome as those two items.  Great program!  Keep up the 
great work.
 
Reply


All articles

Subject Author Date
Two things concerning javascript

04/26/2004 19:20




9

Created with FORUM 2.0.11