Archive for the 'programming' Category

The Serpent in the Shrine (update)

Friday, April 20th, 2007

I’ve finally got round to linking in the footnotes in the text of The Serpent in the Shrine. I put the notes in a table in the back-end database, thinking that I could then call them up using Ajax technology to insert them in the mouseover tooltip. But I changed my mind deciding instead to hardcode them into the title attributes of the relevant anchor tags on the principle that simple is best. So that’s what I’ve done. I have, however, added custom-built tooltips using JavaScript to hold the sometimes substantial footnote content.

Posted in writing, programming | No Comments »

Almost there with Ajax

Wednesday, April 18th, 2007

I’m so close to cracking the Ajax thing (that’s Asynchronous JavaScript and XML - not the Hero from Greek Mythology, nor the chemical cleaning agent). I’ve got it working now finally - I’ve set up the XMLHTTPRequest object, the backend php script to query the database, got the XMLHTTPRequest object communcating with the php script and the server sending back the query result, but there is something still awry with my JavaScript code since it doesn’t do what it is supposed to with the data returned by the server. My knowledge of JavaScript, which was perfunctory a couple of weeks ago, has come on in leaps and bounds but still leaves me down. It’s so frustrating! Aagh!

Posted in Technology, programming | 1 Comment »

Long live multidimensional arrays($cracked_it)!

Wednesday, April 11th, 2007

After hours of struggle I’ve finally managed to get my head around multidimensional arrays! At one stage I thought I would never grasp how these beastly though incredibly useful data structures function. Specifically, I needed to collect rows of the same data fields from a form, add the resultant arrays to a master array, and then insert the same into a mysql database after running all essential data validation checks of course. Many thanks to the sitepoint forums for some useful pointers along the way.

Posted in Technology, programming | No Comments »

A coding challenge . . .

Wednesday, November 29th, 2006

I’m pondering an intersting coding challenge at the moment and trying to decide on a solution. The challenge can be summed up as follows:

How to dynamically generate database queries for placement in tooltips triggered by the title attribute of the anchor tag upon mouseover.

The context is a work of creative writing consisting of numerous small sections some of which have explanatory footnotes. The work is stored in a MySQL database, each section having its own record, and called in sequence by the reader via hyperlink for insertion into a web page. The footnotes are also stored in a separate table in the same database. Footnotes are flagged in the text in the usual manner (superscript arabic numerals).

The challenge is how to insert the text of the relevant footnote (as called up from the database) into the tooltip that appears when the reader mouses over the footnote numeral.
Methinks the answer may lie with Ajax. Any thoughts?

Posted in Technology, programming | No Comments »