Miscellaneous > Programming & Networking
Javascript to help IE users browsing your site.
piratePenguin:
Seeing as we're talking about browsers here I'll put this here.
I cannot believe what I read here.
--- Quote ---Why aren
--- End quote ---
Stryker:
--- Quote from: Refalm ---I dislike the use of JavaScript, because you can disable it in the browser.
If you have PHP on your server, try this:
<?
$bladeraar = $_SERVER['HTTP_USER_AGENT'];
if(eregi("msie",$bladeraar) && !eregi("opera",$bladeraar))
{
echo("<meta http-equiv=\"refresh\" content=\"10;url=http://www.browsehappy.com/\" />");
}
elseif(eregi("mspie",$bladeraar) || eregi("pocket",$bladeraar))
{
echo("<meta http-equiv=\"refresh\" content=\"10;url=http://www.browsehappy.com/\" />");
}
else
{
echo("<meta http-equiv=\"refresh\" content=\"0;url=index2.php\" />");
}
?>
--- End quote ---
I dislike meta redirects because they're not instant and don't always work. If you're doing php, why not:
<?
$bladeraar = $_SERVER['HTTP_USER_AGENT'];
if(eregi("msie",$bladeraar) && !eregi("opera",$bladeraar))
{
header("location: http://www.browsehappy.com");
}
elseif(eregi("mspie",$bladeraar) || eregi("pocket",$bladeraar))
{
location:("location: http://www.browsehappy.com/");
}
else
{
header("location: index2.php");
}
?>
Of course, I hate that too, because it'd redirect to an "index2" and i hate those. Why not just include("checkie.php") at the top of every php file, that way, you can still have the content on the index page.
...just saying...
Aloone_Jonez:
--- Quote from: piratePenguin ---No, I'm talking about something like this (save support definetly possible, just not implemented fully).
--- End quote ---
I had a feeling you meant something like that but there again the only question I have to ask is why?
If I want to edit an SVG I'll use Inkscape rather than a horribly slow web based program - the performance of your program is unacceptable on my machine, MS Draw was much more featured and would run on my old 386.
Refalm:
--- Quote from: Stryker ---I dislike meta redirects because they're not instant and don't always work. If you're doing php, why not:
<?
$bladeraar = $_SERVER['HTTP_USER_AGENT'];
if(eregi("msie",$bladeraar) && !eregi("opera",$bladeraar))
{
header("location: http://www.browsehappy.com");
}
elseif(eregi("mspie",$bladeraar) || eregi("pocket",$bladeraar))
{
location:("location: http://www.browsehappy.com/");
}
else
{
header("location: index2.php");
}
?>
Of course, I hate that too, because it'd redirect to an "index2" and i hate those. Why not just include("checkie.php") at the top of every php file, that way, you can still have the content on the index page.
...just saying...
--- End quote ---
Well, on old PHP versions, sending headers didn't work if another script already send a header.
But yes, it's way better this way, because now the browser can't say no to being sent to another page (by disabling meta tags).
Also, I do not like individual PHP files, I like one that loads all pages from a database and/or text files.
I used this script for a corperate website. I had to use some IE tricks to make transparant PNG images work. Those tricks brake down images on other browsers, so I had to seperate pages.
But for the purpose, it's better to place this script on top the index page, and replace the redirect to index2.php to
echo("");
piratePenguin:
--- Quote from: Aloone_Jonez ---I had a feeling you meant something like that but there again the only question I have to ask is why?
If I want to edit an SVG I'll use Inkscape rather than a horribly slow web based program - the performance of your program is unacceptable on my machine, MS Draw was much more featured and would run on my old 386.
--- End quote ---
It's noticibly faster on FF 1.5 than on Opera 9 on my machine. It's fast enough until you paint too much shit.
And it would be faster if snap wan't enabled by default (everytime you move the mouse over the canvas, the distance to each snappable_point (which could be hundreds - 2 for every line, 1 for every point, 4 for every rectangle, 2 for every freehand) is calculated and checked if it's less than 5 - everytime you move the mouse), but I'm keeping it enabled until I get the UI done (which might be a while) because it's far more fun with it on.
It will be useful e.g. to allow users to draw their own avators on a website. That's not why I started it though - I started it as a proof of concept and for educational purposes.
--- Quote from: Refalm ---Well, on old PHP versions, sending headers didn't work if another script already send a header.
But yes, it's way better this way, because now the browser can't say no to being sent to another page (by disabling meta tags).
--- End quote ---
You can use output buffering (http://ie2.php.net/manual/en/function.ob-start.php, you can also enable it in php.ini with the output_buffering option) to get around that.
Before I discovered PHP's output buffering I used to write the document to a variable and echo it after any headers I might need to be sent are sent - messy.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version