我需要链接哪些文件才能使用ajax [英] What files I have to link for ajax to work

查看:97
本文介绍了我需要链接哪些文件才能使用ajax的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的页面到达执行ajax({})的代码时会挂起。有一个装载机然后它卡住了



我尝试过:



i试图链接ajax外部链接

解决方案

你只需要jQuery库让你的Ajax工作。其他库(如果包含它们)可能会挂起页面,因为它们可能不是异步的,或者它们可能要求其他参数本质上是异步的。

引用:

当我的页面到达执行ajax({})的代码时会挂起。

Ajax中的 A 代表异步。这意味着,代码必须异步执行,并且应该避免保持使主页响应的主线程。我有一些自己的页面,在我的网站上运行,他们是响应。

 


document )。ready( function (){
// 假设您要发送单击按钮时的Ajax请求,其id为btn


#btn)。点击( function (){


my pages hangs when it reaches to execute the code of ajax({}). there comes a loader then it stucks

What I have tried:

i tried to link ajax external links

解决方案

You just need the jQuery library for your Ajax to work. Other libraries, if you include them, might hang the page because they may not be async or they might require other parameters to be async in nature.

Quote:

my pages hangs when it reaches to execute the code of ajax({}).

The "A" in Ajax stands for asynchronous. Which means, that the code must execute asynchronously and should avoid holding on to the main thread which makes the page responsive. I have a few of my own pages, running on my website and they are responsive.


(document).ready(function () { // Assume you want to send Ajax requests on button click, whose id is btn


("#btn").click(function() {


这篇关于我需要链接哪些文件才能使用ajax的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆