views:

911

answers:

3

Just wondering if there are any good server-side libraries for AJAX (prefer JSON rather then XML but anything is good) for classic ASP (VBScript)...

Rather not reinvent the wheel if it's already working and debugged.

Cheers, Gaspard

EDIT: Server-side ASP VBScript... I have already seen many javascript client side libraries.

+3  A: 

Try jQuery. It's amazing!

mnour
hmm looks good for the client side, but I was more interested in ASP VBscript code for the server end
Gaspard Leon
But AJAX is actually for client development. Classic ASP is written in the markup so that combining javascript and jQuery calls with your code will be a piece of cake.
mnour
ok... well I guess you don't understand my question, I can use jQuery or Prototype or Dojo or whatever on the client side, but the client has to call an ASP page to retrieve the data... I would like to use a library there if possible, if none exist I will write it myself.
Gaspard Leon
I've got a nice port of Mootools working Server Side ASP with JScript, you can't do any of the element stuff but you do get all the other goodness including events, string goodies, etc.
Pete Duncanson
+1  A: 

I am using ajaxed which seems to be one of the few still maintained ajax libraries for classic asp out there. Its working very well for me. It's using prototypejs as its js lib. JSON is fully supported.

Michal
A: 

You don't really need a server-side library. Accepting POSTs and GETs from AJAX is the same as accepting them the "old fashioned" way. What is key here are good design patterns.

I commonly use a single function to dispatch my simple Ajax calls in Javascript (I use Prototype):

function fetch(elelment,cmd,id) {
    //general purpose AJAX function
    $(elelment).innerHTML='Loading...<br /><img src="/images/spinner.gif">'
    now = new Date()
    url = 'http://..../Ajax.asp?CMD='+cmd+'&amp;ID='+pid+'&amp;now='+now
    new Ajax.Updater(elelment, url, { method: 'get' });
}

Then on the server side I typically use a select case, break it down by command, fetch the record by the passed ID, and spit out an HTML fragment. I usually build a function to spit out any JSON I need separately.

Diodeus