在 ajax 调用上显示 *browser* 加载指示符(如发生回发时)

2023-05-14前端开发问题
2

本文介绍了在 ajax 调用上显示 *browser* 加载指示符(如发生回发时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

示例:转到您的 Facebook 墙,滚动页面末尾,Facebook 将异步加载更多墙帖.或者只需单击墙上帖子中的图像.图片对话框(带有评论和更大的图片)也在异步加载.(您可以使用 firebug 看到 GET 请求).

example: Go to your Facebook wall, scroll the end of the page, Facebook will load more wall posts asynchronously. Or just click on an images in your wall post. The image dialog (with comments and larger image) is loading asynchronously as well. (You can see the GET requests with firebug).

但是通过查看 firefox 选项卡,您会看到加载指示器,就像发生回发时一样.

But by looking and the firefox tab, you see the loading indicator, just like when a postback occurs.

我知道这可以通过使用 IFrame 并更改其 src 来实现.就像 iGoogle 所做的那样.但我不确定 Facebook 是否使用 IFrame 来加载额外的墙贴.还有其他方法可以实现吗?

I know this can be achieved by using an IFrame and changing its src. Just like what iGoogle does. But I'm not sure if Facebook uses an IFrame to load additional wall posts. Is there another way to achieve this?

更新:通过说加载指示器";我不是说 ajax 指示器.
正如我所提到的,浏览器指示器(在标签的左侧显示页面是否正在加载)会像回发一样变为正在加载.

Update: by saying "loading indicator" I did not mean an ajax indicator.
As I mentioned the browser indicator (the one at the laft side of a tab showing us if the page is loading) changes to loading like it is a postback.

推荐答案

不是 AFAIK.我的猜测是他们可能将 IFrame src 设置为 ajax 方法,并在加载时将内容移动到 div(或其他元素).

Not AFAIK. My guess is they probably set the IFrame src to an ajax method and when loaded, they move the content to a div (or another element).

这篇关于在 ajax 调用上显示 *browser* 加载指示符(如发生回发时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

ajax请求获取json数据并处理的实例代码
ajax请求获取json数据并处理的实例代码 $.ajax({ type: 'GET', url: 'https://localhost:44369/UserInfo/EditUserJson',//请求数据 data: json,//传递数据 //dataType:'json/text',//预计服务器返回的类型 timeout: 3000,//请求超时的时间 //回调函数传参 suc...
2024-11-22 前端开发问题
215

layui 实现实时刷新一个外部的div
主页面上显示了一个合计,在删除和增加的时候需要更改这个总套数的值: //html代码div class="layui-inline layui-show-xs-block" style="margin-left: 10px" id="sumDiv"spanSOP合计:/spanspan${totalNum}/spanspan套/span/div 于是在我们删除这个条数据后,...
2024-11-14 前端开发问题
156

layui 单选框、复选框、下拉菜单不显示问题如何解决?
1. 如果是ajax嵌套了 页面, 请确保 只有最外层的页面引入了layui.css 和 layui.js ,内层页面 切记不要再次引入 2. 具体代码如下 layui.use(['form', 'upload'], function(){ var form = layui.form; form.render(); // 加入这一句});...
2024-11-09 前端开发问题
313

layui table数据表格reload where参数保留
1、创建表格对象 layui.use('table', function () { var table = layui.table; tableObj = table.render({ id: "tableId", url: 'url', //数据接口 elem: '#tableId', page: { limit: 15, limits: [15, 30, 50, 100] }, //开启分页 cols: [[ //表头 ... ]], w...
2024-07-18 前端开发问题
385

layui.render怎么控制某一列是否可以编辑
layui.render控制某一列是否可以编辑,先看代码: ,done:function (res, curr, count){//设置查看量那一列的通过status决定是否可以编辑 let tableView = this.elem.next(); layui.each(res.data, function(i, item) { console.log("curr",curr) if (item.sta...
2024-06-11 前端开发问题
326

Rails 3.1 ajax:成功处理
Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)...
2024-04-20 前端开发问题
11