Re: [WSG] commenting javascript in script tags

2007-04-26 Thread David Hucklesby
On Thu, 26 Apr 2007 10:26:41 +1000, Andrew Harris wrote: 'morning all, It is common and often recommended practice to comment javascript placed in a document. script type=text/javascript language=javascript !-- myVariable = 'woo'; // -- /script Netscape 2 introduced JavaScript

Re: [WSG] commenting javascript in script tags

2007-04-26 Thread Stuart Foulstone
Hi, HTML is not required to be forgiving of minor errors and omissions. It's the normal PC based browsers such as IE, Netscape and Mozilla that developed alongside non-standards coding (and Dreamweaver) that had to be forgiving of errors - not HTML per se. A mobile lightweight browser that does

Re: [WSG] commenting javascript in script tags

2007-04-26 Thread Stuart Foulstone
Hi, Could you explain why the script snippet has to be in the head? Will it have some some adverse effect on other pages if in a common external file? If so, why can't it be in an additional .js file, called only by that page? Stuart On Thu, April 26, 2007 2:47 am, Andrew Harris wrote: On

Re: [WSG] commenting javascript in script tags

2007-04-26 Thread Patrick H. Lauke
David Hucklesby wrote: CDATA sections are required for embedded code only for XHTML. If your file names end in .htm, .html, .php etc. then every browser in the world will treat your XHTML as poorly marked up HTML. Not if you send an explicit XHTML+XML or similar MIME type. P -- Patrick H.

Re: [WSG] commenting javascript in script tags

2007-04-26 Thread Breton Slivka
On 26/04/2007, at 5:19 PM, Andrew Harris wrote: On 4/26/07, Stuart Foulstone [EMAIL PROTECTED] wrote: Could you explain why the script snippet has to be in the head? Will it have some some adverse effect on other pages if in a common external file? If so, why can't it be in an additional

Re: [WSG] commenting javascript in script tags

2007-04-26 Thread Lachlan Hunt
Andrew Harris wrote: It is common and often recommended practice to comment javascript placed in a document. script type=text/javascript language=javascript !-- myVariable = 'woo'; // -- /script Don't bother using those comments, they're a waste of time. The reason cited is that

Re: [WSG] commenting javascript in script tags

2007-04-26 Thread Mordechai Peller
Michael MD wrote: PC-based browsers are forgiving because that's what most users prefer. I don't think most users know enough to even have a preference. The problem is that if many pages don't render properly, they are more likely to blame the browser that the sites. Strictly speaking, most

Re: [WSG] commenting javascript in script tags

2007-04-25 Thread Patrick H. Lauke
Andrew Harris wrote: 'morning all, It is common and often recommended practice to comment javascript placed in a document. ... While I'm on the topic - what about the whole ![CDATA[ ... ]] thing? Use external scripts, and you avoid both issues quite elegantly. P -- Patrick H. Lauke

Re: [WSG] commenting javascript in script tags

2007-04-25 Thread Andrew Harris
On 4/26/07, Patrick H. Lauke [EMAIL PROTECTED] wrote: Use external scripts, and you avoid both issues quite elegantly. Thanks Patrick - I should point out that this question is mostly in regards to a case where the bulk of the js is an external script. I just need to occasionally insert a