I recently ran into an issue with my Ajax call. Here's the code snippet in question:
$("#start-upload-btn").click(function(){
$.ajax({
type: "post",
url: "",
data: {
newProjectName: $('#project-name').val(),
csrfmiddlewaretoken: csrfToken
},
success: function(data){
$("#file-upload").click();
}
})
});
After a successful response, I was expecting the click event on the element with id #file-upload to trigger the file selection dialogue. However, for some reason, it doesn't work when placed inside the success function. Is there any specific scope limitation for the Ajax success function that I should be aware of? I've been trying to debug this but can't seem to find a solution.
Any help or insight would be greatly appreciated. Thank you!