var base_url = '/'; function update_category() { var category_id = $('select1'); var url = base_url + '/product/category_list.php'; new Ajax.Updater( {success:"select2"}, url, { method: "get", parameters: "id=" + category_id.value, onFailure: function() {alert("error");} } ); }