...create a redirect page detecting HTML5 support?

Get help using Construct 2

Post » Sat Nov 05, 2011 7:21 pm

I want to make a normal and HTML five version of my website. I would like the person's browser to automatically detect which one it should use based upon what the browser supports and redirect to the correct version. Does anyone know how to do this?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Sat Nov 05, 2011 7:51 pm

Your index.html can be a blank page with some javascript to do the redirect.

window.location = "http://www.site.com"

Testing for HTML5 is a bit more complicated.Davioware2011-11-05 20:04:15
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Nov 05, 2011 8:02 pm

Ergh... I don't know anything about web development. I was hoping for something simple.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Sat Nov 05, 2011 8:04 pm

By HTML5 version, do you mean an actual website using html5 features, or just a C2 project for the entire site.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Nov 05, 2011 10:02 pm

Davioware helped me out in chat. Anyone who'd like to test the results with whatever browser they have (especially interested in mobile and older browsers), it's at http://www.loot-pursuit.com/redirect/

It should go to www.loot-pursuit.com/html/ with a C2 project that says "HTML" if there is no html5 support, www.loot-pursuit.com/html5/ with a C2 project that says "HTML5" if there is.

I'm also interested to know if at any point the browser prompts you to run or enable scripts, or if you see the Loot Pursuit logo anywhere, which should show as a backup if the page halts for any reason.

Thanks again, Davioware!Arima2011-11-05 22:43:20
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,422

Post » Sat Nov 05, 2011 11:50 pm

Works great. I use Chrome.
If I disable Javascript I get this message:
"Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. What is a browser? "

So it's ok.
B
23
S
5
G
5
Posts: 112
Reputation: 4,737

Post » Sat Nov 05, 2011 11:57 pm

I tried with my good old not upgraded internet explorer 8 that doesn't support sh*t, and I got properly redirected to the html version (:
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests