I saw this on nerd dinner and other sites. When loading a page (in JavaScript, through a browser), an AJAX request will be issued to get some data from the same server that displayed the start page. The data will be small, and there are no technical limitations that would otherwise prevent them from simply tearing down the data in the first place.
Isn't that bad? This seems like a waste of AJAX calls, as they can simply display this data as JavaScript with the rest of the page.
My bank uses AJAX to extract information to create form elements for the "Transfer Funds" form. This information is a few kilobytes, an AJAX request seems redundant.
In a botanical dinner, at least in MIX09, the video that I saw, they request (via AJAX) a set of lunches for rendering on the map control when the page loads.
I could understand if we are talking about large amounts of data that would otherwise take too much time to tear them down, but if there were less than 10-15 kb, would it be better to just pull out the data using markup? Do they do this to avoid data caching?
Change I suggest that instead of opening an AJAX call to the server to pull json data for onload clients, just try asp.net (or something else) to make json in the content of the pages when it does the rest. I just felt the need to point this out, because the actual client-side code would be exactly the same, except where the json variable occurs.
javascript ajax
Allen rice
source share