Re: CDATA on Inline Scripts
- --- In firstname.lastname@example.org, "Paul" <DWTebriel@...> wrote:
>I currently have no plans to support XHTML. Instead, I am improving
> --- In email@example.com, "Douglas Crockford" <douglas@>
> > --- In firstname.lastname@example.org, "Paul" <DWTebriel@> wrote:
> > > I currently have code that looks like the following:
> > >
> > > //<![CDATA[
> > > ...
> > > //]]>
> > > </script>
> > >
> > > Since I'm doing this in xhtml, my IDE likes that tag being there,
> > > otherwise it blows up on typical xml characters like [<]. However,
> > > JSLint is returning a statement such as the following:
> > XHTML is a fiction. If it were real, you wouldn't need to hide the
> > to write your code like this:
> > <script>
> > ....
> > </script>
> > It is smaller, cleaner, faster.
> > Even better, do not put any script in HTML files. Use script src.
> > Separate the markup from the behavior. This tends to lead to better
> > designs. It also can provide better performance because of
> > opportunities for minification, compression, and caching.
> Hey thanks for the reply!
> For the browsers that support a content-type of
> working with the DOM compared to "text/html"? If not, then yeah I
> agree that xhtml, while cool in theory, is sadly fictional.
> The only reason I have inline scripting is so that I can pass data
> directly into a view page from a controller using monorail. I keep all
> event handling and other scripting in separate pages. I would rather
> pass it in on the view than do an additional http request for data on
> top of the initial one personally. Since our web apps here use xhtml,
> I have to use the cdata tags to actually code in real (theoretical?)
> xhtml. So I was just wondering if there was a way to suppress those
> warnings for those commented cdata tags.
the HTML support.