Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<script type="text/coffeescript">
$ ->
@mobileWeb = (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
screen_width = (screen.width)
if @mobileWeb && screen_width <= 768 then $("#mydiv").text "mobile device"
else if @mobileWeb && screen_width > 768 then $("#mydiv").text "tablet"
else $("#mydiv").text "desktop"
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.7.1/coffee-script.min.js"></script>
<div id="mydiv" style="color:black"></div>
</body>
</html>
The most helpful COFFEESCRIPT solutions
how to set color using coffeescript ?COFFEESCRIPT Click to see more ... 832 79