Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   XHTML: <![CDATA[..script..]]> (http://www.velocityreviews.com/forums/t154442-xhtml-cdata-script.html)

Ralf Schneider 08-09-2003 09:43 PM

XHTML: <![CDATA[..script..]]>
 
Hi there,
can anybody help me?

It won't work! Why?
My declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Title</title>
<script language="JavaScript1.1" type="text/javascript">
<![CDATA[
<!--
...script ...
// -->
]]>
</script>
</head>
<body>
<noscript>
<p>Noscript</p>
</noscript>
</body>
</html>

It works without "<![CDATA[..script..]]>"!
Thanks for helping!
Ralf



Sean Jorden 08-09-2003 10:13 PM

Re: XHTML: <![CDATA[..script..]]>
 
"Ralf Schneider" <Ralf.Schneider@nariak.de> wrote in news:bh3qfq$5ne$00$2
@news.t-online.com:


>
> It works without "<![CDATA[..script..]]>"!
> Thanks for helping!
> Ralf
>
>


<![CDATA[ ]]> render the contents as character data
(http://www.w3.org/TR/2000/REC-xml-20001006#dt-chardata)
not markup, so the parser won't process anything in within as tags.


--
In theory there is no difference between theory and practice. In practice
there is. - YB

Ralf Schneider 08-09-2003 10:15 PM

Re: XHTML: <![CDATA[..script..]]>
 
Thousand Thanks!

"Sean Jorden" <s_j_o_r_d.e.n@no.spam.n_o_r_a.d.a.com> schrieb im Newsbeitrag
news:Xns93D2A4CB2383Dsjorden@198.161.157.145...
> "Ralf Schneider" <Ralf.Schneider@nariak.de> wrote in news:bh3qfq$5ne$00$2
> @news.t-online.com:
>
>
> >
> > It works without "<![CDATA[..script..]]>"!
> > Thanks for helping!
> > Ralf
> >
> >

>
> <![CDATA[ ]]> render the contents as character data
> (http://www.w3.org/TR/2000/REC-xml-20001006#dt-chardata)
> not markup, so the parser won't process anything in within as tags.
>
>
> --
> In theory there is no difference between theory and practice. In practice
> there is. - YB




Toby A Inkster 08-09-2003 11:10 PM

Re: XHTML: <![CDATA[..script..]]>
 
Ralf Schneider wrote:

> It won't work! Why?


Current browsers aren't proper SGML interpreters, so don't understand it.

--
Toby A Inkster BSc (Hons) ARCS | mailto:tobyink@goddamn.co.uk | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:tai@jabber.linux.it
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://(nothing)

m 08-10-2003 01:21 AM

Re: XHTML: <![CDATA[..script..]]>
 
Toby A Inkster wrote:
> Ralf Schneider wrote:
>
>
>>It won't work! Why?

>
>
> Current browsers aren't proper SGML interpreters, so don't understand it.
>


I think this is right. It's really no
trouble to push javascript to a sperate
file, anyway, so the questioner need not
fret over it.

HTMLTidy uses a hack to get CDATA to
work with CSS by commenting out the
CDATA declaration with CSS comment tags:
<head>
<style type="text/css">
/*<![CDATA[*/
h4{background:#a54b0d;color:white;width:250px}
/*]]>*/
</style>
</head>

But it's all so ugly.
Just push the stuff out to
sperate linked files so multiple pages
can use them. The difference in
download times on any decent server
will only be a fraction of a second.





All times are GMT. The time now is 05:41 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.