每次ajax或一次加载所有的东西 [英] ajax in each time or load everything at once
问题描述
您在页面上有几个链接。当点击时,通过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屋!