duansha3771 2019-07-30 16:02
浏览 1041

我有一个问题,即加载到javascript。 错误:[弃用]主线程上的同步XMLHttpRequest已弃用

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>
  • 写回答

1条回答 默认 最新

  • duanao3204 2019-07-30 16:16
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码