java - call a method in Javascript file -


in struts 2 based application have java classes , jsps. in jsps have included javascript files.
have java method return string.
want call method in javascript files.
how can this?

struts server side framework, java running on server.

javascript found running in browser (and doesn't sound have involved ssjs solution).

therefore: can't. programs running on different computers , can't interact directly.

you need issue new http request, including data somewhere can retrieved (e.g. in query string). setting location, generating <form> , calling submit() method, using xmlhttprequest object, dynamically adding <script> element src set appropriately , various other approaches.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -