how to liferay include javascript , for borwser versions -
Currently working on liferay with IE8 points. So, I want to divide IE8 and others ..
in lifer-portlet.xml
if (IE8) {'<' header-portlet- javascript '& gt;' / Resources / js / protovis / IE8 / protovis.js '& lt;' / Header portlet-javascript '& gt;' '& Lt;' Title-portlet-javascript '& gt;' / Resources / js / protovis / IE8 / protovis-MSIE-shim.js '& lt;' / Header portlet-javascript & gt; } Other {'& lt;' Header-Portlet-JavaScript & gt; /resources/js/protovis/protovis.js'< '/ header-portlet-javascript & gt; '& Lt;' Title-portlet-javascript & gt; /resources/js/protovis/protovis-msie-shim.js'<, '/ header portlet- javascript & gt; } How can it be obtained?
The simplest way is to do differnt javascritp (if you already have a custom template) in the speed template .
There you can use the IE instructions to tell what the scripts have been included in each browser version. Below one sample:
& lt; Script src = "custom.js" & gt; & Lt; / Script & gt; & Lt ;! - [If IE 9] & gt; & Lt; Script src = "custom.ie9.js" & gt; & Lt; / Script & gt; & Lt; [endif] - & gt; & Lt ;! - [If lte IE 8] & gt; & Lt; Script src = "custom.ie8.js" & gt; & Lt; / Script & gt; & Lt; [endif] - & gt; If you prefer, you can include the script closely by checking the Liferay.Browser variable.
Comments
Post a Comment