BACKBONE.JS detect type browser backbonejs - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

How to detect the type of a browser using backbonejs ?


 238

BACKBONE.JS


1

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.3.min.js " type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.2/underscore-min.js " type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js " type="text/javascript"></script>
</head>
<body>

<p></p>

<script type="text/javascript">

var MyText = _.extend({myIP:'Your browser is: '}, Backbone.Events);

MyText.on('MyFunction', function () {


if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true ))
{
$("p").text(MyText.myIP + "IE");
}
else if(navigator.appVersion.indexOf('Edge') > -1)
{
$("p").text(MyText.myIP + "Edge");
}
else if(navigator.userAgent.toLowerCase().indexOf("op") > -1)
{
$("p").text(MyText.myIP + "Opera");
}
else if(navigator.userAgent.indexOf("Chrome") != -1)
{
$("p").text(MyText.myIP + "Chrome");
}
else if(navigator.userAgent.indexOf("Firefox") != -1 )
{
$("p").text(MyText.myIP + "FireFox");
}
else if(navigator.userAgent.indexOf("Safari") != -1)
{
$("p").text(MyText.myIP + "Safari");
}
else
{
$("p").text(MyText.myIP + "unknown");
}


});

MyText.trigger('MyFunction');

</script>

</body>
</html>


By        
The power of the user (%)
80%



The most helpful BACKBONE.JS solutions

How to get country from client ip address using backbonejs ?How to get country from client ip address using backbonejs ?BACKBONE.JS

Click to see more ...

  942     84

How to bind callback to only fire once before being removed using backbone.js ?How to bind callback to only fire once before being removed using backbone.js ?BACKBONE.JS

Click to see more ...

  665     66

How to detect the type of a device using backbonejs ?How to detect the type of a device using backbonejs ?BACKBONE.JS

Click to see more ...

  574     59

How to detect the version of IE browser using backbonejs ?How to detect the version of IE browser using backbonejs ?BACKBONE.JS

Click to see more ...

  402     53

How to detect mobile device not tablet using backbonejs ?How to detect mobile device not tablet using backbonejs ?BACKBONE.JS

Click to see more ...

  413     51

How to get clients latitude and longitude from ip address using backbonejs ?How to get clients latitude and longitude from ip address using backbonejs ?BACKBONE.JS

Click to see more ...

  450     48

How can I trigger a fucntion using backbone.js ?How can I trigger a fucntion using backbone.js ?BACKBONE.JS

Click to see more ...

  258     46

How can I trigger a function in backbone.sj?How can I trigger a function in backbone.sj?BACKBONE.JS

Click to see more ...

  543     44

How can I trigger multiple functions using backbone.js ?How can I trigger multiple functions using backbone.js ?BACKBONE.JS

Click to see more ...

  342     39

How set and get a value in backbone.js ?How set and get a value in backbone.js ?BACKBONE.JS

Click to see more ...

  236     36

Welcome aboard!
We are happy you are here and
wish you good net-raft!