include和ajax冲突,jsp include vs jquery ajax - Stack Overflow

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.

Closed 8 years ago.

I have a jsp page that has separate modules or widgets on it. To improve the overall load-time of the page, I was thinking of fetching those independent modules in parallel.

I have 2 strategies :

1: JQUERY AJAX

function getSimilars(){

$('#similars').load('getSimilars.jsp');

}

function getActivity(){

$('#activity').load('getActivity.jsp');

}

$(document).ready(function(){

var funcList = ['getSimilars','getActivity'];

$.each(funcList, function(i,v){

window[v]();

})

});

2: STATIC INCLUDE

I know that 1 runs from the browser while 2 runs during compile time. But which of these would make my page load faster?

EDIT:

While the jquery method runs both function in parallel, I think the 2nd method makes those 2 includes run serially. Am I right ?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值