简体   繁体   中英

I have a problem whit load to javascript. Error: [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated

I have an error using .load . It loads the information and everything, but in the browser console it throws the error:

jquery-2.1.4.min.js: 4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check ....

I receive the encrypted arrangements, and in their corresponding files ( ControlDeEquipos.php and ControlDeMateriales.php ) I decrypt them to show them in dynamic tables. All good but as it is a responsive application, on a device with smaller screen it does not load the information and the error mentioned above comes out. My script is as follows:

<script type="text/javascript">
    $(document).ready(function(){

        arrayone = '<?php echo $arrayone;?>';

        arraytwo = '<?php echo $arraytwo; ?>';
        $('#table_arrayone').load('../tablas/ControlDeEquipos.php',{array: arrayone});
        $('#table_arraytwo').load('../tablas/ControlDeMateriales.php',{array: arraytwo});
    });
</script>

If I weren't trying to do this on my phone, I'd come up with a better answer, but this might help:

Javascript alternative of jquery load()

It's not a problem with getting the data from the URL, it's that the best way to do this kind of thing is asynchronously , so the web browser isn't locked up until the response arrives, the way it happens with the old synchronous load method.

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