Welcome to Plant Wars!

Please log in below, or register here.

E-mail Address:

Password:

New? Read about the game here!

Back to the main forum

Topic: I need input on an article.

1

0 05/25/12 3:01:39 PM
The REAL 0gb.us
Id: 10754
Level: 454
Posts: 837
I need input on an article I'm writing. I'm launching a campaign, and I need it to be convincing. Your thoughts? What do I need to do to improve it?

EDIT: Fixing URI
Edited by application/xhtml+xml on 5/25/12 at 3:41:17 pm


0 05/25/12 3:59:14 PM
|η| Noctua Nivalis
Id: 5775
Level: 1516
Posts: 1831
Just for one thing: Does jQuery validate as xhtml if used correctly?

Furthermore, I'd support you if I'd got a site, which I don't. Not that I couldn't write one, I've just got no idea what to put on it.


0 05/25/12 4:12:01 PM
The REAL 0gb.us
Id: 10754
Level: 454
Posts: 837
Thanks for the support!

All JavaScript validates with XHTML, document.write() and innerHTML just don't function.

I can't imagine the jQuery people would have been foolish enough to use innerHTML, because it was never a part of the standard, but I'll check the source code for ".write", as it is a very common occurrence. I'll be right back.

EDIT: Maybe? I can't quite decipher this, but it looks bad.
Quote:
cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>")


Edited by application/xhtml+xml on 5/25/12 at 4:16:07 pm


0 05/26/12 02:02:32 AM
|η| Noctua Nivalis
Id: 5775
Level: 1516
Posts: 1831
They're using document.write(). But notice how they do place a check if the browser supports doctypes before wildly inserting them.

What I don't really get all the time, is why you keep saying document.write() doesn't work with browsers other than IE. I've used it with Chrome and it works just fine...


0 05/26/12 02:52:32 AM
The REAL 0gb.us
Id: 10754
Level: 454
Posts: 837
No, no, that's not what I mean. document.write() does not work when the document it is attached to is sent as an "application/xhtml+xml" as opposed to "text/html". document.write() works as expected in HTML, all known browsers, but is undefined in XHTML.

If you are referring to the post below, it has to do with conditional Content-Type headers. Internet Explorer 8 and below can't handle XHTML at all, so I incorrectly send my content as HTML, not XHTML, only to those browsers. This causes Internet Explorer 8 and below to incorrectly render the page in a language where document.write() actually exists, so my ads get rendered. However, in any decent browser, as well as in Internet Explorer 9, the page is rendered correctly in XHTML, where document.write() is undefined.

Quote:
Even if I drop Internet Explorer support (Which I would seriously love to do. It would be easy, too. All I'd have to do is remove the conditional header.), that doesn't help me with the ads. Currently, all ad solutions I know about OLNY WORK IN INTERNET EXPLORER 8 AND BELLOW, due to use of document.write(). I'm looking for a solution that works in non-Internet Explorer browsers.


Edited by application/xhtml+xml on 5/26/12 at 3:35:01 am


0 05/26/12 03:36:18 AM
|η| Noctua Nivalis
Id: 5775
Level: 1516
Posts: 1831
Then use innerHTML. It works on XHTML 1.0 Strict pages, as can be seen on this page I wrote myself: http://studwww.ugent.be/~fvdrjeug/game.html

It validates as XHTML 1.0 Strict throught the validator.w3.org

It uses Javascript, along with innerHTML.

It works.

Btw, that's the page I wrote some time ago to test for Mariana's game. The game does not follow correct rules, and is full of bugs. Yet it ``works''.

EDIT: Wait, unless this is no "application/xhtml+xml according to you? I did indeed not put that in any header.
Edited by |η| Flamma Furoris on 5/26/12 at 3:40:37 am


0 05/26/12 03:43:52 AM
The REAL 0gb.us
Id: 10754
Level: 454
Posts: 837
The problem is third party code, such as ad network code. I can't choose what code they use, and I can't edit it to work with my site. I have to rely on them to fix it.

Also, innerHTML does not work with XHTML. innerHTML and document.write() are the only JavaScript methods that don't work with XHTML, as far as I know.

http://web-sniffer.net/
Check your headers. Your page is being sent with a "text/html" Content-Type, which is why innerHTML is working for you. For the browser to read it as XHTML, it needs an "application/xhtml+xml" Content-Type header.

Post Reply

1

Back to the main forum