| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) | |
|
Zealot
|
A couple of monts ago, I tried out a snow javascript from hypergurl to create a website, HTML codes, generators, javascripts for my web site. It was ok at first, but once I use the XHTML 1.0 DTD, the script stopped working. Can anybody help me? I want to use the script together with the XHTML 1.0 DTD. This is the script: Quote:
|
|
|
|
|
|
|
#2 (permalink) |
|
goober :-)
|
Not being funny.... but why would you even want to use a snow script? So 1999.... Anyway, the reason it wont work is because the script is using the (horribly outdated) document.write method. This doesnt work with XHTML, because of the way XML (Which XHTML is a subset of) works. You'd have to use a script that used DOM methods instead to achieve the same effect. Like I said though... so 1999... My signature sucks.
|
|
|
|
#5 (permalink) |
|
goober :-)
|
whoa there, zealot... I made a comment that its perhaps not something that you would want to use if you want to keep in with current taste... But then I told you why the script isnt working. You cant use an xhtml doctype with document.write javascript methods, so you have three choices: Either scrap the xhtml doctype, modify the current script to use DOM methods instead, or find a new script. To put it simply, to explain the ins and outs of how to rewite the script, would basically mean me rewriting it myself... And I'm afraid I just dont have the time right now. I tried to be as helpful as I could given the time I have available, but I guess for you thats not enough... My comment stands, though, about it being "1999"... I was trying to steer you away from doing something that will ultimately look tacky, hog client side resources (cause javascript animation tends to do that), and generally be annoying to most consumers. No need to throw your toys out of the pram, now, is there? My signature sucks.
|
|
|
|
#7 (permalink) | ||
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,975
|
Quote:
It's possible that the OP's XHTML markup is still being sent as text/html (i.e. as HTML, but with slight errors). If so, then, as nasty as the method is, document.write should technically still work. (It's not until you start serving the XHTML markup using an XML-based mime-type that things which aren't supposed to work actually stop working - though, in reality, a number of them continue to work). Switching to an XHTML (Strict?) DTD can alter how the browser handles and interacts with the DOM. The same can be said when switching from any Transitional doctype to a Strict doctype. Quote:
|
||
|
|
|
#8 (permalink) |
|
goober :-)
|
Bill, Just to clarify for myself, as far as I know, what you said is only true for IE based browsers, where they ignore the DTD, essentially? In Gekko / Webkit etc based browsers, they will read the DTD and, whilst maybe not serving the document as XML per se, still treat it as such where it applies to the physical rendering of the page? Gah... I hate all this stuff... The fact that different browsers make the page look different is bad enough for those of us who do this every day, but to have browsers physically treating documents as different things? Its stupid. MS has said pretty much outright that they have no plans to further support DTDs, which means on that front we're pretty much stuck in the mud! My signature sucks.
|
|
|
|
#9 (permalink) | |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,975
|
Quote:
'Proper' XML will return the yellow error page on a malformed document. This only occurs when served as XML. Using an XHTML doctype will not trigger this level of XML compliance in any browser, afaik. Additionally, methods such as document.write continue to work so long as the markup is served as text/html, regardless of the doctype used. No version of IE can, as yet, handle application/xhtml+xml correctly, which is the mime-type typically used to serve XHTML markup as XML. It's certainly true that different DTDs can trigger different levels of rendering compliance in different browsers. This is why I invariably stick with full, Strict doctypes - typically XHTML Strict - in order to ensure that all browsers are on their best behaviour. IE browsers certainly do not ignore the DTD. The DTD is possibly more important in IE than in any other browsers. Only when a full and valid DTD is in place do browsers such as IE6 and IE7 enter compliant mode, rendering box models correctly. Other browsers, such as Gecko and Web-Kit based browsers, tend to default to a greater level of compliant rendering, even in the absence of a DTD. Those may be the discrepencies which you had in mind. |
|
|
![]() |