Index: /main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js	(revision 37479)
+++ /main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js	(revision 37480)
@@ -130,5 +130,5 @@
 	var partialPageReload = function(callback)
 	{
-		$.ajax(document.URL)
+		$.ajax(document.URL, { dataType: "text" })
 		.done(function(response)
 		{
@@ -319,5 +319,5 @@
 
 				var url = gs.xsltParams.library_name;
-				var parameters = {"a":"g", "rt":"r", "s":"SaveXMLTemplateToFile", "s1.locationName":_currentLocation, "s1.fileName":_currentFileName, "s1.interfaceName":gs.xsltParams.interface_name, "s1.siteName":gs.xsltParams.site_name, "s1.collectionName":gs.cgiParams.c, "s1.namespace":_currentNamespace, "s1.nodename":_currentNodename, "s1.xml":xmlString};
+				var parameters = {"o": "xml", "a":"g", "rt":"r", "s":"SaveXMLTemplateToFile", "s1.locationName":_currentLocation, "s1.fileName":_currentFileName, "s1.interfaceName":gs.xsltParams.interface_name, "s1.siteName":gs.xsltParams.site_name, "s1.collectionName":gs.cgiParams.c, "s1.namespace":_currentNamespace, "s1.nodename":_currentNodename, "s1.xml":xmlString};
 
 				if(_currentName && _currentName.length > 0){parameters["s1.name"] = _currentName;}
@@ -328,5 +328,5 @@
 				$.blockUI({message:'<div class="ui-state-active">Saving, please wait...</div>'});
 
-				$.post(url, parameters)
+				$.ajax(url, { method: "POST", dataType: "text" , data: parameters })
 				.done(function()
 				{
@@ -495,10 +495,6 @@
 
 		//Populate the file selector
-		var url = gs.xsltParams.library_name + "?a=g&rt=r&o=xml&s=GetXSLTFilesForCollection&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c;
-	    $.ajax(url,
-                   {
-                       dataType: 'text'
-                   }
-                  )
+		var url = gs.xsltParams.library_name + "?o=xml&a=g&rt=r&s=GetXSLTFilesForCollection&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c;
+		$.ajax(url, { dataType: "text" })
 		.done(function(response)
 		{
@@ -610,6 +606,6 @@
 	this.populateTemplateSelectorFromFile = function(filename, location, callback)
 	{
-		var getURL = gs.xsltParams.library_name + "?a=g&rt=r&s=GetTemplateListFromFile&s1.fileName=" + filename + "&s1.locationName=" + location + "&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c;
-		$.ajax(getURL)
+		var getURL = gs.xsltParams.library_name + "?o=xml&a=g&rt=r&s=GetTemplateListFromFile&s1.fileName=" + filename + "&s1.locationName=" + location + "&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c;
+		$.ajax(getURL, { dataType: "text" })
 		.done(function(templateResponse)
 		{
@@ -618,6 +614,7 @@
 			
 			if(templateListStart == "<templateList>".length - 1)
-			{
-				return;
+		        {
+			    console.error("Error retrieving '" + filename + "' templates");
+			    return;
 			}
 			
@@ -688,5 +685,5 @@
 
 		var url = gs.xsltParams.library_name;
-		var params = {"a":"g", "rt":"r", "s":"GetXMLTemplateFromFile", "s1.fileName":filename, "s1.interfaceName":gs.xsltParams.interface_name, "s1.siteName":gs.xsltParams.site_name, "s1.collectionName":gs.cgiParams.c, "s1.locationName":location, "s1.namespace":namespace, "s1.nodename":nodename};
+		var params = {"o": "xml", "a":"g", "rt":"r", "s":"GetXMLTemplateFromFile", "s1.fileName":filename, "s1.interfaceName":gs.xsltParams.interface_name, "s1.siteName":gs.xsltParams.site_name, "s1.collectionName":gs.cgiParams.c, "s1.locationName":location, "s1.namespace":namespace, "s1.nodename":nodename};
 
 		if(match && match.length > 0){params["s1.match"] = match; responseName = "requestedMatchTemplate";}
@@ -694,5 +691,5 @@
 		if(name && name.length > 0){params["s1.name"] = name;}
 
-		$.post(url, params)
+		$.ajax(url, { method: "POST", dataType: "text" , "data": params})
 		.done(function(response)
 		{
@@ -705,6 +702,7 @@
 			}
 			else
-			{
-				return;
+		        {
+			    console.error("Failed to find '" + responseName + "' in POST response");
+			    return;
 			}
 
Index: /main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js	(revision 37479)
+++ /main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js	(revision 37480)
@@ -68,9 +68,7 @@
     if (gs.cgiParams.ck && gs.cgiParams.ck.length > 0) {
 	url += "&ck=" + gs.cgiParams.ck;
-    }
-	
-	
-	
-	$.ajax(url)
+    }		
+	
+    $.ajax(url, { dataType: "text" })
 	.done(function(response)
 	{
@@ -109,23 +107,23 @@
 	template += '<xsl:template match="/">';
 	template +=   '<sections>';
-	template +=     '<xsl:for-each select="/page/pageResponse/document//documentNode[@nodeID = \'' + sectionID + '\']/documentNode">';
-	template +=       '<xsl:call-template name="wrapDocumentNodes"/>';
-	template +=     '</xsl:for-each>';
+	template +=	'<xsl:for-each select="/page/pageResponse/document//documentNode[@nodeID = \'' + sectionID + '\']/documentNode">';
+	template +=	  '<xsl:call-template name="wrapDocumentNodes"/>';
+	template +=	'</xsl:for-each>';
 	template +=   '</sections>';
 	template += '</xsl:template>';
 
-    template = makeURLComponentSafe(template);
-    var url = gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + sectionID + "?ilt=" + template;
-
-    if (gs.cgiParams.p_s && gs.cgiParams.p_s.length > 0) {
-	url += "&p.s=" + gs.cgiParams.p_s;
-    }
-
-       if(gs.documentMetadata.docType == "paged")
+	template = makeURLComponentSafe(template);
+	var url = gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + sectionID + "?ilt=" + template;
+
+	if (gs.cgiParams.p_s && gs.cgiParams.p_s.length > 0) {
+		url += "&p.s=" + gs.cgiParams.p_s;
+	}
+
+	if(gs.documentMetadata.docType == "paged")
 	{
 		url += "&dt=hierarchy";
 	}
 	
-	$.ajax(url)
+        $.ajax(url, { dataType: "text" })
 	.done(function(response)
 	{
@@ -461,5 +459,5 @@
 	}
 
-	$.ajax(url)
+	$.ajax(url, { dataType: "text" })
 	.done(function(response)
 	{
@@ -537,5 +535,5 @@
     }
     else {	
-	$.ajax(url)
+	$.ajax(url, { dataType: "text" })
 	    .done(retrieveFullTableOfContentsSuccess)
 	    .fail(function() {
@@ -704,5 +702,5 @@
     }
 
-	$.ajax(url)
+    $.ajax(url, { dataType: "text" })
 	.done(function(response)
 	{
@@ -968,8 +966,8 @@
 		template +=   '</html>';
 		template += '</xsl:template>';
-	template = makeURLComponentSafe(template);
+		template = makeURLComponentSafe(template);
 		var url = href + "?noText=1&ilt=" + template;
 
-		$.ajax(url)
+	$.ajax(url, { dataType: "text" })
 		.done(function(text)
 			 {
@@ -1307,10 +1305,9 @@
 	template +=   ']</images>';
 	template += '</xsl:template>';
-    template = makeURLComponentSafe(template);
+	template = makeURLComponentSafe(template);
 	var url = gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/document/" + gs.cgiParams.d + "?ed=1&ilt=" + template;
 
-	$.ajax({
-		url:url
-	}).done(function(data) {
+	$.ajax(url, {dataType: "text"})
+	.done(function(data) {
 		var startIndex = data.indexOf(">", data.indexOf(">") + 1) + 1;
 		var endIndex = data.lastIndexOf("<");
Index: /main/trunk/greenstone3/web/interfaces/default/js/visual-xml-editor.js
===================================================================
--- /main/trunk/greenstone3/web/interfaces/default/js/visual-xml-editor.js	(revision 37479)
+++ /main/trunk/greenstone3/web/interfaces/default/js/visual-xml-editor.js	(revision 37480)
@@ -288,7 +288,7 @@
 		else
 		{
-			var url = gs.xsltParams.library_name + "?a=g&rt=r&s=GetTemplateListFromFile&s1.locationName=interface&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.fileName=gslib.xsl";
-
-			$.ajax(url)
+			var url = gs.xsltParams.library_name + "?o=xml&a=g&rt=r&s=GetTemplateListFromFile&s1.locationName=interface&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.fileName=gslib.xsl";
+
+			$.ajax(url, { dataType: "text" })
 			.done(function(response)
 			{
@@ -298,5 +298,5 @@
 				if(startIndex == "<templateList>".length - 1)
 				{
-					console.log("Error retrieving GSLIB templates");
+					console.error("Error retrieving GSLIB templates");
 					return;
 				}
@@ -1150,5 +1150,5 @@
 		var visitCalledTemplate = function()
 		{
-			var url = gs.xsltParams.library_name + "?a=g&rt=r&s=ResolveCallTemplate&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c + "&s1.fileName=" + _fileName + "&s1.templateName=" + _xmlNode.getAttribute("name");
+			var url = gs.xsltParams.library_name + "?o=xml&a=g&rt=r&s=ResolveCallTemplate&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c + "&s1.fileName=" + _fileName + "&s1.templateName=" + _xmlNode.getAttribute("name");
 		
 			var successFunction = function(response)
@@ -1175,8 +1175,8 @@
 			var errorFunction = function()
 			{
-				$.ajax(url).done(successFunction).fail(errorFunction);
+			    $.ajax(url, { dataType: "text" }).done(successFunction).fail(errorFunction);
 			}
 			
-			$.ajax(url).done(successFunction).fail(errorFunction);
+			$.ajax(url, { dataType: "text" }).done(successFunction).fail(errorFunction);
 		}
 
