[web2py] Re: web2py ajax javascript function question regarding return from post request

2015-06-05 Thread Anthony
It's not quite clear what you are asking. Note, the third argument to 
ajax() is not a function but the CSS id of the DOM element where the 
returned HTML should be inserted. If instead of returning and inserting 
some HTML you would like to run some Javascript code upon completion of the 
Ajax call, you can specify :eval as the third argument, in which case, 
the Ajax return value will be treated as Javascript code and run.

Anthony

On Friday, June 5, 2015 at 9:08:27 AM UTC-4, wdtnh wrote:

 Appreciate any help one can offer.  I have an web2py application where I 
 need to perform using the custom web2py ajax function provided with web2py:

 ajax(url, [name1, name2, ...], targetFunction).  

 The post works fine on the server side but I was wondering if there is a 
 way to use this function to catch the new ID (pkey) field value that I need 
 to return and use on the updated webpage.

 I can always go the $.post option but this function has a very clean 
 syntax and is very convenient so I would like to stay with this function.

 Any help greatly appreciated.
 Bill 




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py ajax javascript function question regarding return from post request

2015-06-05 Thread wdtnh
Sorry for the confusion but your answer works just great.  Thanks

On Friday, June 5, 2015 at 10:07:49 AM UTC-4, Anthony wrote:

 It's not quite clear what you are asking. Note, the third argument to 
 ajax() is not a function but the CSS id of the DOM element where the 
 returned HTML should be inserted. If instead of returning and inserting 
 some HTML you would like to run some Javascript code upon completion of the 
 Ajax call, you can specify :eval as the third argument, in which case, 
 the Ajax return value will be treated as Javascript code and run.

 Anthony

 On Friday, June 5, 2015 at 9:08:27 AM UTC-4, wdtnh wrote:

 Appreciate any help one can offer.  I have an web2py application where I 
 need to perform using the custom web2py ajax function provided with web2py:

 ajax(url, [name1, name2, ...], targetFunction).  

 The post works fine on the server side but I was wondering if there is a 
 way to use this function to catch the new ID (pkey) field value that I need 
 to return and use on the updated webpage.

 I can always go the $.post option but this function has a very clean 
 syntax and is very convenient so I would like to stay with this function.

 Any help greatly appreciated.
 Bill 




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.