--- JC Coez <[EMAIL PROTECTED]> wrote:

>  > Not 100% clear what you need.
> > An HTML generated by .jhp page, which 
> > references a .js file?
> > 
> > Or you need to generate the JavaScript using J?
> > Which is referenced from HTML like
> >  <script src="jscript.jhp?param=value"></script>
> > 
> > Please provide detailed example with code and comments.
> > 
>  
> I'll try to clarify.
> I developped a j script and I wanted to use some verbs
> in a jhp file. I thought it would be possible to access directly  
> the j script and its verbs from a javascript function inside that jhp file.
> 
> the test.jhp file looks like :
> ------------------------------------------
> <% ContentType'text/html' %>
> <html><head>
> blabla  
> </head><body>
> blabla
> <% load 'myj.ijs' %>
> blabla
> xx=something() 
> blabla
> yy=something()
> <script>
> function something() {---} 
> function f() { // following a mouse event
> ---
>     toto=<%= xx jverb yy %>
> ---
> }
> blabla
> </script>
> </body></html>
> ------------------------------------------
> and the jverb is defined in myj.ijs
> 
> Do I need to use <script src="jscript.jhp?param=value"></script> in
> my test.jhp and param=value  to access the ijs file and its verbs ? 
> What is the best way to do that ?
> 
> I am a little bit confused as you can see...

I think you are trying to say that you need
an answer from J, which is at the server, after
mouse event in JavaScrit, which are at the client.

There are a couple of ways to do it:
 - with postback: you reload the page navigating to
   .jhp which populates the sought values
 - using Ajax, when you call the server from the
   JavaScript code and get the result into the same page.

For the latter see updated JHP, Ajax Call example.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to