简体   繁体   English

我在加载javascript时遇到问题。 错误:不建议使用[不推荐使用]主线程上的同步XMLHttpRequest

[英]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.phpControlDeMateriales.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.

相关问题 jQuery load()错误:不推荐使用主线程上的同步XMLHttpRequest - jQuery load() error : Synchronous XMLHttpRequest on the main thread is deprecated JS 错误:[弃用] 主线程上的同步 XMLHttpRequest 已弃用,因为它对最终用户的体验不利 - JS Error : [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience 不推荐在主线程上使用同步XMLHttpRequest - Synchronous XMLHttpRequest on the main thread is deprecated 不赞成在主线程上使用同步XMLHttpRequest - Synchronous XMLHttpRequest on the main thread is deprecated XMLHTTPRequest错误:不建议在主线程上使用同步XMLHttpRequest…(SoundCloud API) - XMLHTTPRequest Error: Synchronous XMLHttpRequest on the main thread is deprecated … (SoundCloud API) jQuery加载正在触发主线程上的Synchronous XMLHttpRequest不建议警告 - jquery load is triggering Synchronous XMLHttpRequest on the main thread is deprecated warning 使用jQuery加载外部javascript并禁止“不建议在主线程上使用同步XMLHttpRequest…” - Loading external javascript with jQuery and suppress “Synchronous XMLHttpRequest on the main thread is deprecated…” 主线程上的同步 XMLHttpRequest 在嵌入式 Javascript 代码中已弃用 - Synchronous XMLHttpRequest on the main thread is deprecated within embedded Javascript code 为什么不赞成在主线程上使用ajax调用给出Synchronous XMLHttpRequest错误? - Why ajax call give error of Synchronous XMLHttpRequest on the main thread is deprecated? 向后移动会导致错误:““不赞成在主线程上使用同步XMLHttpRequest…” - moving backward causes error: "“Synchronous XMLHttpRequest on the main thread is deprecated…”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM