xtim
Wednesday, May 19, 2004
 
Now then. That was a corker.

There's a bit of a gap in the http spec as to what should happen when the user clicks an image input on a form. In particular, it's not defined whether the browser should send the coordinates of the click, the name-value pair associated with the input, or both.

Mozilla sends both.

IE, as we've just discovered, only sends the former.

This meant that our atlas handling code was receiving requests for a map centred on pixel 57, 103 of that tile. You know, that one. No index number given - at which point it understandably gave up.

Now fixed. We include a hidden field which lists all tile ids on the page, and each one appends its tile id to its associated control name. The receiving page can then iterate through all possible control names, looking for the one which sent us the click. Once found, we retrieve the click coordinates and proceed as before. A little less efficient than the original algorithm, but more browser-proof. If you're using lynx, I'm afraid you're still screwed.

Re-tagging as monument_3 before release.

T
Comments: Post a Comment

<< Home

Powered by Blogger