I wanted to use a scriplet inside a java script function. I wanted to check for some attribute's vale and give an alert according to that. Following is the function in which the only scriplet statement gives an error.
function UploadMessage() {
<% if((String)request.getAttribute("SuccessMessage").compareTo("Uploaded successfully") == 0) { %>
alert("File Successfully uploaded !");
<%
} %>
}
Is there any way i can do this ? What is the problem here ?
NOTE : I have placed the above snippet in a jsp page