For most <!DOCTYPE>s, <meta> tags are only allowed in the <head> section. Move your code there.
Generally, I prefer not to automagically send users elsewhere with a <meta> refresh. If a page requires JavaScript, I prefer to issue a warning at the top of the page, give the user a plain link to escape, if necessary, and create any critical action elements with JavaScript instead of plain HTML so that the non-js browsers don't display any controls that won't work for those users.
The code snippet was taken from Facebook. They've got it in the head.
If I put it in the head, I get 3 errors, due to the noscript tag and the meta tag.
Noscript, according to W3C should be in the body...
What do you do with the user, when he clicks the click (the escape).
An escape route isn't always possible or practical if the entire site relies on JavaScript. Sometimes all you can do is to inform the user of the situation and let them find their own way out. There's no need to take extreme measures for non-js users. Relatively few users run with JavaScript disabled these days - somewhere in the single-digit percentage range from what I see and read. Do your best to accommodate them when you can, and you should be fine. Good luck!
I want to follow the example of Facebook, the snippet was adapted from there and I think they really do a good job for the non-JavaScript audience. I want to do the same, and am quite happy with my architecture.
All of the tag subtitution is now done in PHP and works well without JavaScript - no worries.
your suggestion is much appreciated, would work and is elegant.
I read it carefully.
I just don't want to completely overhaul the architecture I'm happy with.
Your way, which is definitely a more classic way, the "default" page would be for the audience with JavaScript disabled - as I understand. Then in case JavaScript is enabled, I would jump to the "real" full breed page.
The main problem is, that the first and main URL would be very ugly
e.g.
Code:
http://4nf.org/bo.php?u=http://4nf.org/
Customers would have to place links to that page, which they surely don't want to...
If I understood that wrong, please let me know.
No, I'm following the FaceBook architecture:
- "Default page" - assume JavaScript enabled
- in case not - graceful descent to the escape page
My only worry is how to make the mentioned snippet validate.
I've been told not to worship the W3C validator too much.
Maybe I'll have to live with the error...
- Include an unconditional redirect to http://4nf.org/bo.php from that client page
- Perform all tag substitution in PHP and include your formidable JS-snippet
- In that snippet redirect back to the client page http://www.oeko-fakt.de/ and enjoy full JS and AJAX functionality!
What do you think of that architecture? Is it cleaner?
Another thing to keep in mind arvgta, if you are automatically handling the processing with PHP you'll be showing to Google your links you were trying to hide...
Bookmarks