top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to detect what browser is being used with jQuery?

+2 votes
431 views
How to detect what browser is being used with jQuery?
posted Feb 2, 2016 by Abhishek Maheshwari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

You can use the jQuery Migrate plugin and call the $.browser. It will work!

Using the plugin is easy; just include it immediately after the script tag for jQuery, for example.

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.js"></script>

JS:

$.each($.browser, function(i, val) {
  $("<div>" + i + " : <span>" + val + "</span>")
  .appendTo( document.body );
});
answer Feb 3, 2016 by Manikandan J
Similar Questions
+3 votes

I want to delete cookies whenever user is navigating away from my page.

Cookies should be cleaned when user delete tab/browser or user change URL and press enter. It should not be deleted when user press 'F5' or click other link in same page.

0 votes

Is there any browser simulator that fulfills these requirements:

  • gem written in Ruby
  • automatically performing Ajax and Javascript code (XSS is not an issue in my case)
  • independent of the frameworks used by the website (Rails, JavaEE, ASP.NET, ...)
  • only client-side
  • no testing
  • no browser dependency
...