If you’re following along in the Gist, here’s the errors I see:
Line 1: This is not a proper opening tag. You can’t have spaces between a < and the word script – it just isn’t a real tag that way. Write it as just like that. Language as an attribute for a script tag is deprecated in any version of HTML after 3.
Line 2: This is an HTML comment, inside a JavaScript block. It won’t do anything there. It used to be popular when Netscape Navigator used to be popular, because other browsers of that era would choke on inline JavaScript, but it is not needed or used any more.
Line 7: Another HTML comment opening block, invalidating the first one (you cannot nest comments inside other comments in HTML). Line 7 also includes a closing comment tag, but because of the nested comment, it’s ambiguous which one it is closing. This will probably cause an error.
Line 13 - 20: Multiple instances of document.write() and writeln(). This is deprecated in any version of HTML over 4 Transitional. If your page is HTML 4 Strict, XHTML Transitional or Strict, or HTML5, you will probably not get what you expect with this approach to writing a visible element into the page. The correct modern way to do this is with createElement/addChild or innerHTML=, both of which modify the DOM, rather than trying to write HTML into the tag tree before the DOM is rendered.
Line 27: Another closing comment, again, ambiguous what if anything it will do.
Walter
On Nov 25, 2013, at 2:44 PM, DeltaDave wrote:
can you explain what’s dodgy about the code and how I could change that?
Walter said: Note this had several structural problems, and doesn’t work in any context as written.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options