I use an included opensource javascript framework called prototype that has some nice shortcuts.
Right now I'm working on a new site: http://portfsa.org/tools/c
That page has a calculator on it. When the user leaves a field, it actually sends a call to the server, gets the updated calculation and places the result in the subtotal box. (not some javascript calculator script working client-side)
calls this script:
function morris_ajax_v_1_0(params,i
// var params = "test=1"
var url = "/ajax/calculator.asp"
new Ajax.Request(url, {
method: 'get',
parameters: params,
onSuccess: function(transport) {
// var data = transport.responseText.eva
// $('total_current_cash_need
setvals(transport.response
}
});
}
which returns simple JSON that is generated with asp using variables that are adjusted by the client in their database.
{'total_current_cash_needs
Feel free to rip out whatever you'd like if you're interested :)
Main Topics
Browse All Topics





by: DanielcmorrisPosted on 2009-04-30 at 16:47:30ID: 24275431
use an ajax script