I am brand new to JAVA (JSP and JSTL)
I make an Ajax call to an api endpoint and in the callback I want to load a jsp file, which contains jsp. So, I do something like
AjaxQueueManager.get("/xyz/abc/" + efg,
function(data) {
if (data.success) {
$(element).html('');
} else {
getResourcesFailureCallback(element, data.errors, "ocon-wrong", "Something's Wrong!");
}
},
function(error) {
console.log("#####", error.status, error.statusText);
}
);
If my jsp-file.jsp doesn't contain any javascript all works well for example, if I put
Hello World
it works fine, but as soon as I put javascript in the jsp file even the most basic javascript like
console.log("hello world");
I get an error
Uncaught SyntaxError: Invalid or unexpected token
$(element).html("
I understand the error, its cause of " getting mixed with the " of type="text/javascript" but I dont know how to fix it.