function updateRecord(actdate, plandate, bugnumber) {
var adate = document.getElementById(actdate).value.split("-");
var pdate = document.getElementById(plandate).value.split("-");
jQuery.ajax({
url: '?=bug_parser/updaterecord/'+adate[0]+'/'+adate[1]+'/'+adate[2]+'/'+pdate[0]+'/'+pdate[1]+'/'+pdate[2]+'/'+bugnumber,
dataType: 'html',
async:true,
crossDomain:true,
success: function(response, textStatus, jqXHR) {
if(response == '1') {
alert("success");
} else {
alert("Failed");
}
},
error: function(jqXHR, textStatus, errorThrown) {
alert('Error updating the record');
},
});
return false;
}
I am trying to update a record through ajax call on button click event. Have proper menu call backs in my drupal module. Interesting thing is that, if I copy paste the url in browser navigation bar, it works fine as expected. But if I make ajax call through javascript it doesnot work