Forum Moderators: mack

Message Too Old, No Replies

XHTML and scripts?

         

ataru

5:08 am on Jun 7, 2003 (gmt 0)

10+ Year Member



I'm trying to write an XHTML-compliant webpage that uses Javascripts. After some research, I saw some information that indicated that current browsers won't recognize the <![CDATA[...]]> directive. Is there any workaround to this to generate functional server-side scripting in XHTML-compliant code? Thanks!

waldemar

10:11 am on Jun 7, 2003 (gmt 0)

10+ Year Member


As far as I know this is the official way of implementing javascript code in xhtml:

<script type="text/javascript">
//<![CDATA[
<!-- Script Start

.......your javascript code......

// Script End -->
//]]>
</script>

ataru

2:53 pm on Jun 7, 2003 (gmt 0)

10+ Year Member



Hm, yeah, that's how W3C says to do it - the problem I see is that current browsers don't like that, and they won't execute the script...

waldemar

3:59 pm on Jun 7, 2003 (gmt 0)

10+ Year Member



How can they not like it if it's in comments? :-)

I'm using this technique and so far don't run into problems with ie 6 or mozilla 1.2... What browser did you have problems with?