The last time I used this script (January 2009), it only worked for us with Internet Explorer. This is not sure though, as it was a modified version because of the special requirements of a client.
I cannot comment about what you added in awstats.pl , as there are several typing mistakes in your message.
The path you specify must be valid for the browser. So, if the Linux path to tablesort.js is …/wwwroot/js/tablsort.js , you should have something like this in awstats.pl :
The sort JavaScript as used in the project of January did not work in Firefox and in Opera (not tested with Safari), but it worked in Internet Explorer and this was good enough for the customer, so we did not investigate further.
When we have to sort AWStats results, we usually use our aws2xls, AWStats to .xls converter. Once the AWStats file is converted to an Excel (Microsoft) or Calc (OpenOffice) file, it is easy to sort it in any way you like. A key difference between our script and the JavaScript from Frequency Decoder is that they can only sort the lines on the screen while our aws2xls sorts all the lines in any section of the AWStats database.