News flash: 30 Apr 2025
Sample CSS and JS (a new file)
References:
JavaScript: The Good Parts (i.e. a slim volume)
Douglas Crockford
O'Reilly
jQuery Cookbook
jQuery Community Experts
O'Reilly
jQuery UI
Eric Sarrion
O'Reilly
URLs:
jQuery homepage
jQuery UI homepage
DataTables homepage
2013-04-11: Here's an error message from Chrome:
Uncaught ReferenceError: HASH is not defined
And here's the context in which I got it:
o I'm using jQuery.
o I displayed a list of notes with each one having a Delete and Update link.
This list is in a div within a CGI form.
o The Delete link looked like this:
Note: The $$row{id} syntax is Perl, which interpolates the value of $$row{id} into
the onClick string at run-time, i.e. when the Delete link HTML is generated as a
response to an Ajax call.
The Javascript function delete_person_note(id) is defined globally.
And yes, the '#' in that link is the '#' referred to in the error message.
The solution below will make it clearer.
o Elsewhere in the CGI form I had code to add a note.
o Immediately after displaying all existing notes, I could delete any number of them,
one at a time, by clicking on the corresponding Delete link.
o However, after adding a note, the list of notes was updated by being returned from
the Ajax call which added the new note to the database.
This includes regenerating the list of Delete and Update links (on the server) and using
jQuery to empty() the div holding the list, and calling append(html) with the new list.
o The solution:
Part 1: At the bottom of the form, I now have:
Part 2: The Delete link now says:
o So, the href now refers to a target which is defined. Since it is defined close to the div being updated,
the browser does not follow the link, but just updates the list of notes as returned from the server.
o Put away those 2 asprin; You don't need them now...
o Lastly, here's the command to convert HTML into an image. Of course, you first have to put
the HTML into 1.txt.
Top