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

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];


      }




   


}


Hi Christopher,



May I know where you have written this onLoad() script?



It would be helpful if you share here.



Thanks & Regards,


Ram Prakash


Hi Ram,


I think it was just in a client script, I forget on which table but it shouldn't matter really, I just wanted to verify if the code would work.


Hi Christopher,



Not sure on which table I need to write this code.



Can you please check and let me know that?



Thanks & Regards,


Ram Prakash


Hi Christopher,



Do you have any idea how to show it while logging in the instance?



Thanks & Regards,
Ram Prakash