RE: [WSG] Internal CSS in XHTML served as application/xhtml+xml
Derek, have a read through http://devedge.netscape.com/viewsource/2003/xhtml-style-script/ ...but to answer the question quickly: it should work if you use //![CDATA[ //]] Patrick Patrick H. Lauke Webmaster / University of Salford http://www.salford.ac.uk -Original Message- From: Derek Featherstone [mailto:[EMAIL PROTECTED] Sent: 09 July 2004 16:28 To: [EMAIL PROTECTED] Subject: RE: [WSG] Internal CSS in XHTML served as application/xhtml+xml Roger wrote: Anyway, I was wondering if, and how, other people hide internal CSS in XHTML documents from user agents that don't support CSS. Note that this is about cases when moving the CSS to an external file is not an option, for whatever reason. On a related note -- I recently setup content negotiation on WATS.ca to serve our XHTML as application/xhtml+xml and most of the site worked fine. The one spot where it failed was with inline JavaScript -- we have a resources page ( http://www.wats.ca/resources/testingtools/44 ) that contains many JS bookmarklets which then caused loads of parsing errors, and they don't display in gecko based browsers... Normally, I would move all the JS to an external file as well, but in this case, it doesn't really make sense. I considered moving the JS for each bookmarklet to its own .js file, but that eliminates the utility and ease with which someone can drag and drop the bookmarklet onto their bookmarks bar in their browser, so isn't an acceptable solution. So, I'm looking for a way to escape inline javascript, and not really sure if there are any solutions to that problem... Thoughts on this would be appreciated as well... I could futz about with our system to always serve that page as text/html, but would prefer to send it as application/xhtml+xml if I can. Best regards, Derek. -- Derek Featherstone [EMAIL PROTECTED] phone: 613.599.9784; toll-free: 1.866.932.4878 (North America) Web Accessibility: http://www.wats.ca Web Development: http://www.furtherahead.com Personal: http://www.boxofchocolates.ca * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help * * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help *
RE: [WSG] Internal CSS in XHTML served as application/xhtml+xml
Patrick wrote: have a read through http://devedge.netscape.com/viewsource/2003/xhtml-style-script/ ...but to answer the question quickly: it should work if you use //![CDATA[ //]] Right, but that only deals with JS embedded in its own script/script block. I've used that before if I wasn't able to remove the JS and put it in an external file. This breaks down though, for references like this in the page for bookmarklets (pardon the length): a href=javascript:var l=document.links.length;var s='';for (i=0;il;i++){var lk=document.links[i];s+='tr valign=top';s+='td' + lk.innerHTML + ' /td';s+='td' + lk.title + ' /td';s+='tda href='+lk.href+'' + lk.href + '/a/td';s+='/tr';}s='Links for: '+document.location.href+'table border=1 style='font:x-small verdana'tr valign=topthText/ththTitle/ththURL/th/tr'+s+'/table';var lw=window.open('', 'lw', '');lw.document.open();lw.document.write(s);lw.document.close(); Links and Titles /a Adding proper escape sequences to inline JS in this case just won't work, or perhaps I'm missing something? Best regards, Derek. -- Derek Featherstone [EMAIL PROTECTED] phone: 613.599.9784; toll-free: 1.866.932.4878 (North America) Web Accessibility: http://www.wats.ca Web Development: http://www.furtherahead.com Personal: http://www.boxofchocolates.ca * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help *
RE: [WSG] Internal CSS in XHTML served as application/xhtml+xml
This breaks down though, for references like this in the page for bookmarklets (pardon the length): but wouldn't you say that bookmarklets are a bit of a perversion of the standard, in which case it becomes academic to discuss how these can be served in a standards-compliant way? or is it just me? Patrick
RE: [WSG] Internal CSS in XHTML served as application/xhtml+xml
This breaks down though, for references like this in the page for bookmarklets (pardon the length): but wouldn't you say that bookmarklets are a bit of a perversion of the standard, in which case it becomes academic to discuss how these can be served in a standards-compliant way? Oh, I agree completely -- I was just hoping that someone somewhere might have come across a method that would let me serve it up properly... What I'll likely end up doing is serve that page as text/html - it's the only solution that I can see, if I want to serve the rest of the site as application/xhtml+xml I won't lose too much sleep over it... ;) Cheers, Derek. -- Derek Featherstone [EMAIL PROTECTED] phone: 613.599.9784; toll-free: 1.866.932.4878 (North America) Web Accessibility: http://www.wats.ca Web Development: http://www.furtherahead.com Personal: http://www.boxofchocolates.ca * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help *
Re: [WSG] Internal CSS in XHTML served as application/xhtml+xml
On Fri, 9 Jul 2004 11:28:22 -0400, Derek Featherstone [EMAIL PROTECTED] wrote: On a related note -- I recently setup content negotiation on WATS.ca to serve our XHTML as application/xhtml+xml and most of the site worked fine. The one spot where it failed was with inline JavaScript -- we have a resources page ( http://www.wats.ca/resources/testingtools/44 ) that contains many JS bookmarklets which then caused loads of parsing errors, and they don't display in gecko based browsers... I could be misunderstanding, but seing as bookmarklets require JavaScript, why not use JavaScript in an external file to populate the content on the page to start with? You could then use a noscript block to explain to people that in order to see and use the bookmarklets, they need a JavaScript-enabled browser? -- Kay Smoljak http://kay.smoljak.com * The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list getting help *