How to identify the user browser

Eli Guttman
Tera Guru

Hi,

How can i check if the user is using IE browser? i need to check it in the platform (not in service portal)

If someone if familiar with relevant client script, it will be very helpful.

 

thank you

1 ACCEPTED SOLUTION

asifnoor
Kilo Patron

Hi,

You can create an onload catalog client script like below. The variable is_ie will contain a boolean value true/false. If IE, it will store true, otherwise false.

function onLoad() {
   //Type appropriate comment here, and begin script below
   var ua = navigator.userAgent;
  /* MSIE used to detect old browsers and Trident used to newer ones*/
  var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
  console.log("If using internet explorer: "+is_ie);
}

Also attached is the screenshot for reference.

find_real_file.png

 

Kindly mark the comment as a correct answer and also helpful once worked.

View solution in original post

8 REPLIES 8

Hi Ashvini,

 

thanks, but i need to identified it on client script when the form is loaded / submitted

Aman Kashyap
ServiceNow Employee
ServiceNow Employee

This can be done using GlideAjax and script include.

Please look into this community answer where the complete code is also mentioned.

asifnoor
Kilo Patron

Hi,

You can create an onload catalog client script like below. The variable is_ie will contain a boolean value true/false. If IE, it will store true, otherwise false.

function onLoad() {
   //Type appropriate comment here, and begin script below
   var ua = navigator.userAgent;
  /* MSIE used to detect old browsers and Trident used to newer ones*/
  var is_ie = ua.indexOf("MSIE ") > -1 || ua.indexOf("Trident/") > -1;
  console.log("If using internet explorer: "+is_ie);
}

Also attached is the screenshot for reference.

find_real_file.png

 

Kindly mark the comment as a correct answer and also helpful once worked.

Ashwini35
Tera Contributor

Does anyone have idea to achieve this in service portal?

 

Thanks