每次ajax或一次加载所有的东西 [英] ajax in each time or load everything at once

查看:80
本文介绍了每次ajax或一次加载所有的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您在页面上有几个链接。当点击时,通过ajax更新div。更新的div包括数据库中的数据。



根据这种情况,每次点击链接时,日期都将从数据库中获取并注入到div中。 / p>

你现在可以;



1)支持这种情况或...
2)将加载每个链接的内容在几个隐藏的div中,并在每个链接上显示相关的div点击。这样一来,ajax调用只会被调用一次。

解决方案

依赖...是否会改变内容?如果是这样... Ajax每次。
如果没有? Ajax一次(如果可以,则为零)


you have several links on a page. when clicked, a div gets updated via ajax. the updated div includes data from the database.

according to this scenario, every time a link is clicked, the date is grabbed from the database and injected into the div.

would you now;

1) support this scenario or... 2) would load each link's content in several hidden divs and display relevant div on each link click. this way the ajax call is only called once..

解决方案

depends... is the content going to change? If so... Ajax every time. If not? Ajax once(or zero times if posible)

这篇关于每次ajax或一次加载所有的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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