123
123
function do_action(action, path, args, content_type, ignore_response)
125
125
args.action = action;
126
/* Callback action, when the server returns */
127
var callback = function(response)
129
/* Check for action errors reported by the server, and report them
131
var error = response.getResponseHeader("X-IVLE-Action-Error");
133
alert("Error: " + error.toString() + ".");
134
/* Now read the response and set up the page accordingly */
135
if (ignore_response != true)
136
handle_response(path, response);
126
138
/* Call the server and perform the action. This mutates the server. */
127
response = ajax_call(service_app, path, args, "POST", content_type);
128
/* Check for action errors reported by the server, and report them to the
130
error = response.getResponseHeader("X-IVLE-Action-Error");
132
alert("Error: " + error.toString() + ".");
133
/* Now read the response and set up the page accordingly */
134
if (ignore_response != true)
135
handle_response(path, response);
139
ajax_call(callback, service_app, path, args, "POST", content_type);
138
142
/** Calls the server using Ajax, requesting a directory listing. This should
148
152
function navigate(path, editmode)
154
callback = function(response)
156
/* Read the response and set up the page accordingly */
157
handle_response(path, response, editmode);
150
159
/* Call the server and request the listing. This mutates the server. */
151
response = ajax_call(service_app, path, null, "GET");
152
/* Now read the response and set up the page accordingly */
153
handle_response(path, response, editmode);
160
ajax_call(callback, service_app, path, null, "GET");
156
163
/** Determines the "handler type" from a MIME type.