The CreatorCon Call for Content is officially open! Get started here.

Is there a way from a client script to determine if the current UI is UI14 or UI11?

Dan Spada
Tera Contributor

Is there a way from a client script to determine if the current UI is UI14 or UI11?

 

We have a client script that we want to run if the current version is UI 14, but not if it's UI11. Essentially this has come from IE8 and below not supporting some of our customizations.

 

One way is to use Javascript to get the navigator.appVersion property and check the browser version, though this seems like it could get messy when the current UI version will give us the information we require.

 

Is there a built in property that will give us this information?

 

Cheers,

 

Dan

1 ACCEPTED SOLUTION

Good point, I suppose he would already know if the property was set to true or not anyway.   I found something online that seems to work when I dumped it in an onLoad script:



function onLoad() {


    //Type appropriate comment here, and begin script below




var browser=get_browser();


var browser_version=get_browser_version();


alert(browser + " - " + browser_version);




function get_browser(){


      var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];


      if(/trident/i.test(M[1])){


              tem=/\brv[ :]+(\d+)/g.exec(ua) || [];


              return 'IE '+(tem[1]||'');


              }    


      if(M[1]==='Chrome'){


              tem=ua.match(/\bOPR\/(\d+)/);


              if(tem!=null)     {return 'Opera '+tem[1];}


              }    


      M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];


      if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}


      return M[0];


      }




function get_browser_version(){


      var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];                                                                                                                                                                                                                                                


      if(/trident/i.test(M[1])){


              tem=/\brv[ :]+(\d+)/g.exec(ua) || [];


              return 'IE '+(tem[1]||'');


              }


      if(M[1]==='Chrome'){


              tem=ua.match(/\bOPR\/(\d+)/);


              if(tem!=null)     {return 'Opera '+tem[1];}


              }    


      M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];


      if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}


      return M[1];


      }




   


}


View solution in original post

11 REPLIES 11

If you want to execute the code when Users log into the Instance, you can utilize a global UI Script as shown in this post - How to change the size of custom company logo in banner?


Hi Christopher,



How could we take this script and (after detecting which browser) redirect those on IE8 to a different link. Those on other browsers can go through to the normal login page, but we'd like to redirect those on IE8 to our portal where they would login with IE10.



thanks,



Richelle