Uncaught TypeError: cannot read property ‘msie’ of undefined jquery datepicker

Issue because of missing js file.
Download “jquery-1.7.2.js” and include in required place and then check once again.

Divs swapping based on window width & screen rotate

/*Based on window width*/
if ($(window).width() < 767) {

/*Sreen rotate event*/
if($(window).width() > 767){

Cursor suddenly jumping from textarea

If we use typejs in our document this type of issue will occur find below code to fix.
$(“.textarea”).bind(‘keypress’, function(e) {
if(e.which == 32){
var textarea_val = $(“.textarea”),
val_ask = textarea_val.val();

Sessions functionality in jQuery

Find below code for handling sessions in jQuery.

/*Set session value*/
$.session.set(‘session_key’, ‘a value’);

/*Get session value by key*/
$sess = $.session.get(‘session_key’);

/*Remove session*/

/*Remove all sessions*/

Browser close & reload events in jQuery

/*Browser close jQuery event*/
Put this code body tag –> onunload=”doUnload()”

Below code for script
function doUnload()
if(window.event.clientX < 0 && window.event.clientY <0){
var cookieName = ‘suitebeb123’;

/*Broser reload javascript function*/
window.onbeforeunload = function (e) {
// Your logic to prepare for ‘Stay on this Page’ goes here

Cookies functionality in jQuery

/*Create cookie*/
$.cookie(cookieName, cookieValue);

/*Create cookie with expiry time*/
var expDate = new Date();
expDate.setTime(expDate.getTime() + (15 * 60 * 1000));
$.cookie(cookieName, cookieValue, { expires: expDate });

/*Get cookie value*/
var cook = $.cookie(‘cookieName’);

/*Remove cookie value*/

Disable/enable submit button & readonly to textbox using jQuery

Using attr()” function we will enable or disable submit button please find below code.

$(document).ready(function() {
$(‘input[type=”submit”]’).attr(‘disabled’, true);
$(‘input[type=”text”]’).on(‘keyup’,function() {
if($(this).val() != ”) {
$(‘input[type=”submit”]’).attr(‘disabled’ , false);
$(‘input[type=”submit”]’).attr(‘disabled’ , true);

/*Add and remove readonly to a textbox*/

if(rBtnVal == "yes"){
         $("#no_of_staff").attr("readonly", false); 
         $("#no_of_staff").attr("readonly", true); 

Check if a page has a vertical scrollbar or Horizontal Scrollbar using jQuery?

Please find below code to find scrollbar

jQuery(document).ready(function() {
    // Check if body height is higher than window height :)
    if (jQuery("body").height() > jQuery(window).height()) {
        alert("Vertical Scrollbar!");

    // Check if body width is higher than window width :)
    if (jQuery("body").width() > jQuery(window).width()) {
        alert("Horizontal Scrollbar!");