AJAX: server side JavaScript
I just found this post with a very interesting idea: code does not need to exist on the client beyond connection scripts; JavaScript can be sent to browser to be executed; basically, remote invoking via passing of code (aka using eval with JavaScript received from the result handler)
Just like everything else, it has its pro's and con's, but overall, I think that in a security and even lazy loading standpoint this is a great idea.
I guess it really depends if you are using AJAX as an add-on for a web application, or to build a full application. In a robust application, the 'init' call will load all those JS components that need to be persistent and leave them on memory, and all the rest of the calls can only transfer and load the needed JavaScript, thus optimizing initial loading time.
What do you think?
Just like everything else, it has its pro's and con's, but overall, I think that in a security and even lazy loading standpoint this is a great idea.
I guess it really depends if you are using AJAX as an add-on for a web application, or to build a full application. In a robust application, the 'init' call will load all those JS components that need to be persistent and leave them on memory, and all the rest of the calls can only transfer and load the needed JavaScript, thus optimizing initial loading time.
What do you think?
TrackBacks
There are no trackbacks for this entry.
Trackback URL for this entry:
http://www.robgonda.com/blog/trackback.cfm?829A86C4-3048-7431-E4D3F91982EAA2E0
http://www.robgonda.com/blog/trackback.cfm?829A86C4-3048-7431-E4D3F91982EAA2E0









The initial client loads prototype and a couple of other base libraries (scriptaculous and the custom app engine core). On the server side I've got a crazy-simple method that's capable of delivering the content of other js files via CFFILE reads. When the user logs in as an administrator, for instance, the administrative components of the engine are delivered and evaluated.
Prototype's object.extend is perfectly suited to this. The .js file simply delcares an object populated with functions. The client-side function that fetches the code extensions just evaluates the text of the returned file and tacks the methods on to the main client engine: Object.extend(engineInstance,evaluatedObject);