homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Xhtml 1.1 dtd
Disabling JS Function in Opera

 1:47 am on May 26, 2002 (gmt 0)

For some reason or another Opera 6 no longer sees this external JS function, it happened after updating my code with the XHTML 1.1 DTD. Netscape and IE present no problems. It does read the first JS function in my external script, so I'm thinking I might have something wrong below: (Of course, it all validates)?

<script type="text/javascript">

Thanks as always for ye help...



 3:14 am on May 26, 2002 (gmt 0)

When all else fails >> un-install :: re-install;)


 8:16 am on May 26, 2002 (gmt 0)

I never really do any js but I'm almost certain that you need to enclose the function in CDATA




 9:44 am on May 26, 2002 (gmt 0)

Nick, this was new territory for me, so I did some research - you are exactly right. If you use <script> tags within the XHTML document, the format is exactly as you posted. External scripts called from the HEAD need no special treatment.

Here's the W3C reference on Differences Between HTML 4 and XHTML [w3.org]. Scroll down a bit for Item 4.8 - Script and Style Elements

(edited by: tedster at 1:15 pm (utc) on May 26, 2002)


 10:22 am on May 26, 2002 (gmt 0)

Me, too. I've never used it but just remember reading the theory a while back. Using that method can, apparently, be a little tricky with old browsers though.



 3:53 pm on May 26, 2002 (gmt 0)

Both IE6 and Opera6 failed to implement this method. Of course, I might of missed something...

Thanks for the link Tedster-


 5:37 pm on May 26, 2002 (gmt 0)

<script type="text/javascript">

:: // -- Will keep <![CDATA[]]> from halting your JS.
:: IE6 NN6.2/7 Opera6;)

Doing a search on "PCDATA" and "CDATA" on SEW will present excellent info on the subject.


 7:37 pm on May 26, 2002 (gmt 0)

I've read the W3C reference as well, and since the few javascripts I use are all external, I have not had the need to use the CDATA designation.

Without a doubt there are going to be more than a few "stubbed toes & scraped knuckles" until Web developers migrating to XHTML become familiar with the requirements for embedded javascript. Time for a "HEADS UP!"

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved