[英]I have a problem whit load to javascript. Error: [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated
I have an error using .load
. 我使用
.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.
jquery-2.1.4.min.js:4 [Deprecation]不赞成在主线程上使用同步XMLHttpRequest,因为它对最终用户的体验有不利影响。 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. 我收到了加密的安排,并在它们的相应文件(
ControlDeEquipos.php
和ControlDeMateriales.php
)中解密了它们,以在动态表中显示它们。 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() jquery load()的Javascript替代
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. 从URL获取数据不是问题,这是异步执行此操作的最佳方法,因此直到响应到达之前,Web浏览器才被锁定,这是使用旧的同步
load
方法发生的方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.