I am trying to make a website using JSP. In the onload event, a JavaScript function should run, in the JSP template for the function, I use an if condition. The goal is to check for a URL parameter and only actually run a function when that parameter is found.
Here is my code:
<script language="javascript">
function raj(){
<%if (String "contact"=request.getParameter("contact");) %>{
<% String str=request.getParameter("video"); %>
var s="<%=str%>";
alert(s);
}
}
</script>
What went wrong, and how can I fix it?
("contact")<here>