Where to put IE version detect code

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Where to put IE version detect code

Post by adams1 » Tue Nov 21, 2017 3:42 pm

In Joomla 3.8.2 where to put this code (and codes like this):

<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->

I use Protostar template and would like to use with override.

adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Re: Where to put IE version detect code

Post by adams1 » Thu Nov 30, 2017 6:22 pm

Or just simply how to detect too early browser versions in Joomla (3.8.2)?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30919
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Where to put IE version detect code

Post by Per Yngve Berg » Thu Nov 30, 2017 9:43 pm

Put it in the template's index.php where the html tag is rendered.

adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Re: Where to put IE version detect code

Post by adams1 » Fri Dec 01, 2017 5:18 pm

Per Yngve Berg wrote:Put it in the template's index.php where the html tag is rendered.
Thank You!
Can you tell similar browser commands for Firefox, Chrome and Opera?

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Where to put IE version detect code

Post by sozzled » Fri Dec 01, 2017 7:45 pm

adams1 wrote:Can you tell similar browser commands for Firefox, Chrome and Opera?
Similar "codes" (or commands) like what? Please provide some examples.

adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Re: Where to put IE version detect code

Post by adams1 » Fri Dec 01, 2017 9:22 pm

sozzled wrote:
adams1 wrote:Can you tell similar browser commands for Firefox, Chrome and Opera?
Similar "codes" (or commands) like what? Please provide some examples.
Similar commands to these:

Code: Select all

<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
But Firefox, Chrome and Opera related (if there are any). I need because I might want to check the versions for these browsers too.

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Where to put IE version detect code

Post by sozzled » Fri Dec 01, 2017 9:33 pm

I don't understand your question. "Similar codes" can mean anything. What, specifically, is it about different versions of Firefox, Google Chrome or Opera that you wish to detect? What, specifically, are different about different versions of those browsers that you are concerned about and need to allow for? Where have you read that you need to detect for different versions of those web browsers?

Please give examples of what you have found in your research.

AFAIK, Internet Explorer is probably unique among the commonly used web browsers insofar as different versions cause unusual behaviours between them. Generally-speaking, other browsers are not as finicky in terms of handling HTML, CSS or Javascript between different releases of them. Also, and this may be relevant, because other web browsers are not "bundled" with an operating systems (like Internet Explorer and Edge are with Microsoft Windows) there's usually less reason to handle such cases differently because people are more likely to update those other web browsers; therefore, there's less to be concerned about.

In my [very humble] opinion, different versions of IE have a number of known knowns. I wouldn't be too concerned about unknown unknowns that affect FF, Chrome or Opera if you don't know what they might be. Remember also that this is the Joomla forum; it is not the repository of all information about various peculiarities with every web browser that's in use today. In conclusion, if you re attempting to handle different behaviours with various web browsers then such handlers should be located between the <header> and </header> tags.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9729
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Where to put IE version detect code

Post by AMurray » Sat Dec 02, 2017 4:44 am

There are other, easier ways to alert to browsers that are too old....there's a number of plugins that do this such as such as https://extensions.joomla.org/extension ... e-warning/ - not only for IE but any of the mainstream browsers, will alert you the version is too old and prompt you to update it.

I assume this is what you're actually trying to do?
Regards - A Murray
General Support Moderator

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9729
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Where to put IE version detect code

Post by AMurray » Sat Dec 02, 2017 4:49 am

Others are also available - see this https://extensions.joomla.org/category/ ... standards/
Regards - A Murray
General Support Moderator

adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Re: Where to put IE version detect code

Post by adams1 » Sat Dec 02, 2017 5:46 pm

sozzled wrote:I don't understand your question. "Similar codes" can mean anything. What, specifically, is it about different versions of Firefox, Google Chrome or Opera that you wish to detect? What, specifically, are different about different versions of those browsers that you are concerned about and need to allow for? Where have you read that you need to detect for different versions of those web browsers?

Please give examples of what you have found in your research.

AFAIK, Internet Explorer is probably unique among the commonly used web browsers insofar as different versions cause unusual behaviours between them. Generally-speaking, other browsers are not as finicky in terms of handling HTML, CSS or Javascript between different releases of them. Also, and this may be relevant, because other web browsers are not "bundled" with an operating systems (like Internet Explorer and Edge are with Microsoft Windows) there's usually less reason to handle such cases differently because people are more likely to update those other web browsers; therefore, there's less to be concerned about.

In my [very humble] opinion, different versions of IE have a number of known knowns. I wouldn't be too concerned about unknown unknowns that affect FF, Chrome or Opera if you don't know what they might be. Remember also that this is the Joomla forum; it is not the repository of all information about various peculiarities with every web browser that's in use today. In conclusion, if you re attempting to handle different behaviours with various web browsers then such handlers should be located between the <header> and </header> tags.

Well I just simply thought that if there are major and/or important differences between the Internet Explorer versions (for example between IE8 and IE9; JavaScript and CSS issues) then I might want to filter out similar differences between the versions of the other mainstream browsers (that would affect my site) and after filtering out, alert the user to refresh his/her one.

But if there aren't any important differences (so in Safari (forgot to mention), Opera, Chrome, Firefox and other popular browsers) since long ago - or even if there are some, but won't beat my Joomla 3.8.2 site (with AdsManager extension) - then the question is irrelevant.

(But if there are any important differences that would affect the site, then I would like to alert the user for update. - Do you have suggestions related to this problem, if you are aware of anything? Of course I don't want you or anyone to describe all of these, but starting point(s) would be greeted. Or you say I shouldn’t bother with these (if I understand correctly)? )
(So the site: AdsManager extension, Joomla 3.8.2. The site uses JQuery.)
Also excuse me for not mentioning enough information related to my question or not being obvious.

Thank You!

adams1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Fri May 12, 2017 7:34 am

Re: Where to put IE version detect code

Post by adams1 » Sat Dec 02, 2017 5:56 pm

AMurray wrote:There are other, easier ways to alert to browsers that are too old....there's a number of plugins that do this such as such as https://extensions.joomla.org/extension ... e-warning/ - not only for IE but any of the mainstream browsers, will alert you the version is too old and prompt you to update it.

I assume this is what you're actually trying to do?
Yes it is. I want to filter out the browsers that won't work with my site (so Joomla 3.8.2, AdsManager, JQuery that is built in these, etc) and ask the user for browser update.
I'm considering the usage of this extension though I think it would be better to check simply with these HTML directives (or whatever) since they need no update not even installation. But maybe I'm wrong.


Locked

Return to “Joomla! 3.x Coding”