|Post date: 2007-05-10 14:53|
Sure you COULD use AJAX, but it's overkill for this application.
On the top of my head - Something like this could be sufficent:
var traceError=new Image();
Note! Remeber to escape the characters properly.
In the document you have corresponding fields to store the different elements: @URLQueryString("Error") etc...
To get the originating page you can simply use the CGI variable: HTTP_referer.
You can use this approach to log anything you like even if the user don't have JS enabled by including an IMG-tag on your page, like so:
<img src=<your_log_db>/<formname>?CreateDocument&<whatEver>=<something> width="1" height="1" alt="logTracer" style="display: none;" />
I'm using it and it's blistering quick on a optimized database. It takes under 20ms to create a log document that contains only one elment, expect this to increase as you add fields/logic.