Project

General

Profile

« Previous | Next » 

Revision 5783

use post() method rather than load() when the div is not given - allows calling a metacat method without replacing any content on the page

View differences:

branding.js
302 302
**/
303 303
function load(url, params, divId) {
304 304
	try {
305
		$("#" + divId).load(
306
			url, 
307
			params,
308
			// call back function when loading finishes
305
		// call back function when loading finishes
306
		var callback = 
309 307
			function(response, status, xhr) {
310
				//alert("callback for: " + divId + " selected node: " + selectedNodeId);
311 308
				// error
312 309
				if (status == "error") {
313 310
					var msg = "Sorry but there was an error: ";
314 311
					$("#error").html(msg + xhr.status + " " + xhr.statusText);
315 312
				}
316
			});
313
			};
314
		// replace div with content	
315
		if (divId) {
316
			$("#" + divId).load(
317
				url, 
318
				params,
319
				callback);
320
			} else {
321
				// just post without replacing content
322
				$.post(
323
				url, 
324
				params,
325
				callback);
326
			}	
317 327
		} catch (e) {
318 328
			// do nothing - jQuery was probably not included
319 329
		}

Also available in: Unified diff