I'm having some issues trying to write a function that compares two strings from textboxes. It works fine in IE, but falls over during testing in Chrome and Firefox. I've got a sample of the code here, but I'm unsure as to the best way to make this work across browsers:
Never mind, I found the problem - IE's Javascript engine is playing too fast and loose with the rules: It accepts both 'name' and 'id' fields in document.getElementbyId, whilst Firefox and Chrome require corresponding 'id' fields to be set in order for the function to work.
You have also an HTML error: your document has no Doctype. And the notation <br />
is specific to XHTML not to HTML. Make up your mind: either HTML Doctype and rules or XHTML Doctype and rules.
You should. Without a Doctype (that means in quirksmode) browsers do interpret the javascript and CSS codes in peculiar and different ways than the standard way, thus your test will be unconvincing. Moreover, HTML/XHTML errors might change, distort or even block the JavaScript effects.
Whenever you encounter a JavaScript or CSS problem, make sure, first, that the HTML/XHTML pattern code is correct and valid.
Bookmarks