Calling Java inside JavaScript Function

后端 未结 8 985
时光取名叫无心
时光取名叫无心 2020-12-04 02:26

Please tell me if we can call java inside javascript function ?


    

        
8条回答
  •  爱一瞬间的悲伤
    2020-12-04 02:41

    JSP runs on the server. It generates a document which the server sends to the browser. That is the end of the involvement of JSP in the process. The browser then parses the document and runs any JS.

    You can include JSP in a script element, it just has to output valid JavaScript.

    You cannot have JSP that runs in response to JavaScript, other then when JavaScript causes the browser to issue a new HTTP request (either setting location.href, submitting a form, adding an image, or using Ajax, etc)

提交回复
热议问题