+1 Point for Prototype
I just replaced 4,650 lines of javascript with this
var myRequest = new Ajax.Request(’ajax/get_product_data.php?’, {
method: ‘get’,
parameters: ‘product_id=’+$F(’product_list’),
onSuccess: function(transport) {
var product_data = transport.responseText.evalJSON();
$(’category_list’).value=product_data.product_category;
$(’unit_cost’).value=product_data.unit_cost;
}
});
You read that correctly - 4,650 lines.
Powered by ScribeFire.