I am new in Java and JSP. In some case, Javascript help me to do some functions in JSP, so I want to know, is it common to embed javascript in JSP program in commercial environment? or I should try to code java Functions. Who has idea on it ?
They really have nothing to do with each other. Any Java in a JSP is executed on the server in order to format an HTML page to send to the browser. Any Javascript on this HTML page is interpreted by the browser just like any other HTML page.
Thanks a lot. you mean that both (java and javascript) are common used in normal JSP programs, is it correct ? Only one difference, Java is executed in server side, but Javascript is interpreted in client browser.
If you need to do something on the client such as showing messages in alerts etc. then you write in javascript. javascript functions are loaded onto the client from server and they dont go back to server for execution. Java gets executed on server side and not on client side.
Originally posted by Ray Law: Thanks a lot. you mean that both (java and javascript) are common used in normal JSP programs, is it correct ? Only one difference, Java is executed in server side, but Javascript is interpreted in client browser.