Detect device in jQuery
Sometime we need to detect device in jQuery to identify the screen, To add some extra or different logic according to the requirement. 5 ways to detect the mobile Devices in jQuery Solution 1:- Using navigator userAgent. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { // mobile device code } Solution 2:- Using window matchMedia method $(function() { […]
setTimeout() and setInterval in jQuery
Today we will discuss about setTimeout() and setInterval function in jQuery . setTimeout function :- The setTimeout() is executed only once.Use the clearTimeout() method to prevent the function from starting.By calling clearTimeout() you can to stop the execution. var myTimeout = setTimeout(function () { // Your logic }, 2500); // 2500 are milliseconds // to […]
Redirect using jQuery
Redirect To Another URL Using JQuery Or JavaScript,Using plain JavaScript there are different way to redirect the user to a different web page.This code also work in jQuery code.You can try below methods – Redirection : A page automatically goes to another page then it is called a redirection. The redirection of a web page […]