AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



jsp-javascript: How to write javascript values in jsp page

i just want to execute part of jsp code which i write in javascript with javascript values

jsp x 32
javascript x 33
Posted On : 2016-10-28 09:22:01.0
profile Surya Prakash - anyforum.in Surya Prakash
400
up-rate
4
down-rate

Answers


You can do something like this:

<script>
function get(){
var m="Hello";
window.location.replace("h.jsp?mess="+m);
}
</script>
<input type="button" onclick="get();" value="click">
<%String message=request.getParameter("mess");
out.println(message);
%>

Note:
----------------------
We can´t use javascript variable directly in server side script. For more information visit here:

Access JavaScript variable in JSP and Vice Versa?- Click Here

Posted On : 2016-11-09 22:03:43
Satisfied : 1 Yes  0 No
profile Rishi Kumar - anyforum.in Rishi Kumar
523188221600
Reply This Thread
up-rate
3
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in