Commit 12b70f12 authored by Siddhant Sanyam's avatar Siddhant Sanyam

jquery's username and pasword is broken. Fixed everything related to $.ajax....

jquery's username and pasword is broken. Fixed everything related to $.ajax. Now we can Auth on GET. Make sure you have <LimitExcept OPTION>require valid-user</LimitExcept> in your Dav .htaccess
parent a3308dcc
......@@ -40,8 +40,11 @@ saveXHR = function(address) {
$.ajax({
url: address,
type: "PUT",
username: "smik",
password: "asdf",
headers: {
Authorization: "Basic "+btoa("smik:asdf")},
fields: {
withCredentials: "true"
},
data: JSON.stringify(getCurrentDocument()),
success: function(){alert("saved");},
error: function(xhr) { alert("error while saving");}
......@@ -53,8 +56,11 @@ loadXHR = function(address) {
url: address,
type: "GET",
cache:false,
/* username: "smik", No need to specify credential while GETTING
password: "asdf",*/
headers: {
Authorization: "Basic "+btoa("smik:asdf")},
fields: {
withCredentials: "true"
},
success: function(data){
var cDoc = getCurrentDocument();
cDoc.load(JSON.parse(data));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment