DOM Load and Save

The W3C recommendation for scripting a HTTP connection without reloading the entire page. A similar but less vapourwarish technology is Microsoft's XMLHttpRequest; it has the advantage of actually being implemented in most modern browsers (IE, Mozilla, Opera).

DOM Load and Save is currently only implemented in Opera 7.6 and above.

Example of usage

Derived from molily:

if (document.implementation.hasFeature("LS", "3.0")) {
	var parser = document.implementation.createLSParser(
		document.implementation.MODE_SYNCHRONOUS,
		'http://www.w3.org/TR/REC-xml');
	try {
		var doc = parser.parseURI("testdata.html");
		window.alert(doc.getElementsByTagName("title")[0].childNodes[0].nodeValue); // reads the title of the page; not quite clean!
	} catch(e) {
		window.alert("Could not load data: code " + e.code);
	}
} else {
	window.alert("DOM load&save not supported!");
}
No comments on this page. [Display and/or add comments]