开发者

Loading a page with AJAX for beginners

Please can someone give me some direction on the best way to implement AJAX?

Basically i have a classic ASP site that has recently been upgraded to .Net, and i've got the scenario where i would like a slow page to be displayed quickly. Part of the data displayed on the page takes several seconds to load, i would like to load up everything else, and use AJAX to load the slow part.

I'm not sure开发者_开发技巧 what the best method is? Should i be using jQuery, AJAX controls, etc.?

Sorry if this has been asked before, just looking for some pointers or good links. Thanks


I think jQuery would be a great choice to plug into a classic ASP site. This link has some decent content for first-time ajaxers with jQuery:

http://articles.sitepoint.com/article/ajax-jquery


You can use AJAX controls to get AJAX functionality, and that would be the fastest and easiest way to implement AJAX.

However, if you are wanting to learn more about how to implement AJAX, and want a better overall solution, I would suggest jQuery. jQuery is faster, will give you more flexibility, and what you learn will be transferable to other web technologies like PHP, JSP, etc.


This is a useful link describing using the jQuery .load() function, which is how you get jQuery to load up page elements asynchronously:

http://api.jquery.com/load/

An example on how to use it can be found in the following (self promoting) blog post:

http://iainhoult.blogspot.com/2010/07/using-jquery-to-asynchronously-load.html

I think if you wanted to go the jQuery route for AJAX then this would fit in well with your converted ASP website.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜