I got round to adding a stylesheet that doesn’t fail completely in Internet Explorer. While I was at it I also fixed up the fancy (pointless) Find as you type functionality on my search box so that now should work in IE too. Ooh AJAX how very modern.
Note to self:
element.style.styleFloat = 'left';
Users with a browser that can display both stylesheets can now choose which style they’d like to use. Please try to contain your excitment.
Fixing the search was pretty much a case of adding the code to create an Internet Explorer flavour
object and using the right method to hook up the event handlers —
attachEvent for IE,
addEventListener for the others. However in the process I did encounter one interesting(ish) oddity. When
creating a checkbox dynamically using
document.createElement if you want to set the checked property in
Internet Explorer this has to be done after the element has been appended to the document. So (assuming
someform is a reference to an element in the document) using,
var cb = document.createElement('input'); cb.setAttribute('type', 'checkbox'); cb.setAttribute('name', 'bleh'); cb.setAttribute('checked', 'checked'); // cb.checked = true would do the same someform.appendChild(cb);
adds the checkbox to the form but doesn’t correctly set the checked property, whereas if you use,
var cb = document.createElement('input'); cb.setAttribute('type', 'checkbox'); cb.setAttribute('name', 'bleh'); someform.appendChild(cb); cb.setAttribute('checked', 'checked');
everything works as expected.
The last thing I attempted to fix was the script I wrote for quotes. Essentially you highlight a section of text in the page and press the C key to insert the text (with appropriate markup) into your comment. The nice part was that based on the
target element when the key was pressed it could work out if the quote was from an existing comment and automatically add that information too. Unfortunately so far I can only make IE report the
srcElement (it’s equivalent to
target) when the key is pressed as being the
body. I guess this one still needs some work…
There are currently no comments for this item.
Sorry, comments for this item are currently closed.