简体   繁体   中英

jQuery modal is not working in latest version and event.returnvalue is deprecated error

I am using a javascript function for some sort of validation,

EDIT

I made an edit to below function with exact piece of code that works in firefox but not in chrome and gives below errors,

function check_time () {
    var start_time = $("#start_time select").val();
    var end_time = $("#end_time select").val();

    var stt = new Date("November 24, 2013 " + start_time);
    stt = stt.getTime();
    var endt = new Date("November 24, 2013 " + end_time);
    endt = endt.getTime();

    if(stt > endt || stt == endt) {
        $('#popup_box').show();
        return false;
    } else {
        $('#popup_box').hide();
        return true;
    }
}    

This works absolutely fine in Firefox, but in Chrome, I got an error, and my script doesn't execute:

event.returnvalue is deprecated. please use the standard event.preventdefault() instead

I followed this link,

I changed my jQuery version to 1.10.2 and also tried with 2.0.3.

Still won't work in chrome, and by using this, jQuery modal fails to load except of screen size overlay, and console shows this error..

c.browser is undefined // line 396 in my jquery-ui-1.8.12.custom.min.js version

my jQuery and css files are:

<link rel="stylesheet" href="<?=base_url()?>public/css/jquery-ui-1.8.12.custom.css" type="text/css"   />
<script type="text/javascript" src="<?=base_url()?>public/scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="<?=base_url()?>public/scripts/jquery-ui-1.8.12.custom.min.js"></script>

Please guide me to resolve these two issues below,

  1. if i use 1.7.1 that I was previously using, modal works fine, but I got chrome error.
  2. if i use 1.10.2 or latest version of jQuery to get rid of Chrome error, I face both "chrome" error and "modal" error

The issue related to e.returnValue is a warning not an error.

The main problem is jQuery ui 1.8.* which uses features that were removed in jQuery 1.9.

Use jQuery migration plugin for backward compatibility if you can't upgrade jQuery ui

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM