How do you detect IE now?

Hi,

I’ve just found, that in M$'s infinite wisdom, they have totally changed the way IE11 reports itself to HTTP_USER_AGENT:

So now, instead of just doing (in perl):

    if ($ENV{HTTP_USER_AGENT} =~ m/MSIE/) {
        $IN->param('isIE' => 1);
    }

It seems we have to do:

    if ($ENV{HTTP_USER_AGENT} =~ m/MSIE|Trident/) {
        $IN->param('isIE' => 1);
    }

…is that safe for other browsers?

Also, conditionals seems broken as well (as per my link above). I couldn’t even get a basic one going (aparantly its MEANT to work, but didn’t for me);

<!--[if IE ]>
  <script>alert("FOO");</script>
<![endif]-->

They say “replace with feature checks” … well thats all good and well - but on my site, the problem is with IE not playing nice with some padding on my rows… so I’m having to add in some code that will actually add some additional padding (just for IE).

Am I the only one who’s finding this a royal PITA?

Cheers

Andy

Really, you shouldn’t have to be doing hacks for modern versions of IE. The latest versions have dumped conditional comments, because they are not needed. And browser sniffing belongs on the scrap heap.

If you are having a styling issue, feel free to post a link or some example code. Modern IE is pretty advanced CSS- and JS-wise.

Hi,

Yup, tell me about it!

The page is: http://steampunkjunkies.net/

If you check it in FF/Chrome, there is meant to be some padding between the rows of the items. In IE, this doesn’t happen. Its using Bootstrap 3 BTW. I did a little hack (which I’ve removed, just so you can see), with:

	<%if isIE%>
		<style>
		.iePadding{
			height: 5px; width: 3px;
		}
		</style>
	<%else%>
		<style>
		.iePadding{
			display: none;
		}
		</style>
	<%endif%>

…and then added a div right after the items, which only gets shown in IE.

Oh… and I still hate IE :wink: haha

TIA!

Andy

Which version of IE are you having trouble with? I only have up to IE9, but it looks fine in that browser (same as Chrome.)

Hi,

IE9 - see attached :slight_smile:

Testing in IE9 (via IETester), I get the same issue (missing the padding between rows)

TIA

Andy

That’s exactly what I see in Chrome, though. There’s no padding set between rows. That’s easily fixed, though. E.g.

.row {
padding-bottom: 20px;
}

Duh - I see whats going on. When I log out of FF, its ok. When I log back in, the padding is there again. Not sure why its doing that. Will do some digging :slight_smile:

Ok, I got it :slight_smile:

<div id="actions<%want_id%>" class="well well-sm"[B] style="margin-bottom: 0"[/B]>

I was being lazy and using well well-sm, as I couldn’t be bothered to make a new class for my admin functions… however, that mean’t it also added extra margins I didn’t want. I’ve just fixed it by removing the margins from that particular part of the page, and it works a charm

Thanks for working through this with me! :wink:

Cheers

Andy

No worries. Glad it’s sorted. :slight_smile: