Just a heads up before you dive in: I've encountered an issue with Safari related to Chrome, but it seems to work fine on other browsers. So, it could be more OS-specific rather than a general problem.
I recently ran into a frustrating situation while making an Ajax call - I couldn't get any console logs for success
or error
. After adding an alert("test")
, I finally got some feedback. Now, I'm puzzled as to why console.log()
isn't cooperating while alert()
is working just fine. I stumbled upon this helpful post, but my scenario seems to be the opposite. Can anyone shed light on what might be going wrong? Here's the code snippet:
function AjaxFormSubmit(){
event.preventDefault()
$.ajax({
headers: { "X-CSRFToken": getCookie("csrftoken") },
url :"/about/",
type : "POST",
data : 1,
dataType: "html",
success : function(data) {
alert("test");
console.log('Success!');
},
error : function(xhr,errmsg,err) {
console.log("fail");
}
});
I'm using Safari on Mac Sierra 10.12.5, and this issue is completely new to me. Other console.log
statements have been working without a hitch. Any insights would be greatly appreciated.