Clients know EVERYTHING *yay finally solved*

Get help using Construct 2

Post » Sun Feb 12, 2012 12:17 pm

Ok so, my client is a bonehead.

He just about exploded when he saw the "your browser does not support this page" thing that I made, to give the user a choice in either navigating to the "crappy" static version of the site, or upgrading the browser.

This is apparently too hard for him to comprehend and being the corporate moron he is, he wants it to just forward the user straight to the crappy static site with no choice in the matter.

I have tried throwing a few redirect scripts in the mix, in the index.html file to no avail. They either don't work, or redirect HTML5 capable browsers to the crappy version of the site.

Any ideas how I can get this thing to do what he has ignorantly requested?

~Sol
SoldjahBoy2012-02-12 12:18:30
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Feb 12, 2012 12:36 pm

After an hour of messing around, I decide to post this topic to find the solution minutes later.

I ended up using a meta redirect, which seems to be fine.

In case anyone else wants to use this, here is what I did;

Somewhere in between the <canvas></canvas> tags, simply paste this bit of code:

<meta http-equiv="refresh" content="2; URL=http://www.whatever.com">

So simple and it worked. All of the javascript methods, and php methods either didn't work or redirected the page on perfectly capable browsers.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Feb 12, 2012 12:49 pm

Ok so I'm stupid and forgot to clear my cache.

It still redirects capable browsers.

Help required still :/

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Feb 12, 2012 2:23 pm

Thanks to Shviller, I went and checked out:
http://www.modernizr.com/

This tool will be VERY HANDY for anyone doing WEBSITES in HTML5, especially using C2.

It has a whole bunch of "tests" it performs in nano-seconds to see if the browser is capable of HTML5 or not.

I simply added the .js file to my working directory, then added this code to my index.html file;

------------------------------

<script src="modernizr.js"></script>
<script>if (Modernizr.canvas) {
// let's draw some shapes!

} else {
// no native canvas support available :(
     window.location = "http:www.your-redirection-here.com"
     var msg = 'With a different browser youll get to see the WebGL experience here: \
            get.webgl.org.';
   document.getElementById( '#notice' ).innerHTML = msg;
}
</script>

---------------------

I added it at the bottom, just above the </html> tag.

Works like a charm!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Feb 12, 2012 4:14 pm

Good stuff ! :)
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Sun Feb 12, 2012 6:05 pm

[QUOTE=SoldjahBoy] Thanks to Shviller, I went and checked out:
http://www.modernizr.com/

This tool will be VERY HANDY for anyone doing WEBSITES in HTML5, especially using C2...[/QUOTE]
Oh yes, anyone doing cross-platform web development should be definitely be using Modernizr to avoid plunging into browser hell.

Browser sniffing is so 20th century
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Sun Feb 12, 2012 6:10 pm

[QUOTE=Velojet] [QUOTE=SoldjahBoy] Thanks to Shviller, I went and checked out:
http://www.modernizr.com/

This tool will be VERY HANDY for anyone doing WEBSITES in HTML5, especially using C2...[/QUOTE]
Oh yes, anyone doing cross-platform web development should be definitely be using Modernizr to avoid plunging into browser hell.

Browser sniffing is so 20th century [/QUOTE]

Yes it's the first I had heard of it.

This will be simply magnificent!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966


Return to How do I....?

Who is online

Users browsing this forum: adi pratama and 24 guests