Pass jQuery result to callback

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pass jQuery result to callback

laura
Hi all,

I want the following to occur to when an anchor (with href set to ‘javascript:{}’, the issue is that the page shouldn't  be re-renderer) is clicked
1°find some information on the rendered html page
2°send it back from client side
jQuery allows me to make scripts for both steps (for 1° query methods, for 2° #callback:). My problem is i don't know how to bind these two steps in a single script, since from what i know i can't add and asign to a smalltalk temp inside a script and i can't perform queries from within a callback block (cause the html renderer no longer exists). So, how do i add a temp variable inside the script and how i merge the 3 resulting "step" scripts into one?

Love,
Laura

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pass jQuery result to callback

Paul DeBruicker

Does JQAjax>>#callback:value: & friends do what you need?

e.g.

html anchor
     url:'#';
     onClick:(html jQuery ajax callback:[:val | self processValueFromPage: val] value:(html jQuery id:'myDiv') data);
     with:'send data to server'




laura wrote
Hi all,

I want the following to occur to when an anchor (with href set to
‘javascript:{}’, the issue is that the page shouldn't  be re-renderer) is
clicked
1°find some information on the rendered html page
2°send it back from client side
jQuery allows me to make scripts for both steps (for 1° query methods, for
2° #callback:). My problem is i don't know how to bind these two steps in a
single script, since from what i know i can't add and asign to a smalltalk
temp inside a script and i can't perform queries from within a callback
block (cause the html renderer no longer exists). So, how do i add a temp
variable inside the script and how i merge the 3 resulting "step" scripts
into one?

Love,
Laura

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Pass jQuery result to callback

laura
Happily it does!
I had seen the methods before and felt excited to try them, but after reading on method #callback:value: the comment "Note: anObject should be a single literal Javascript object (String, Number" i thought i couldn't pass as argument of #value: something like 
(html jQuery id:'myDiv') data
cause afaik that is an JQueryInstance instance.

Such a lovely tool Seaside!
Thank you Paul for solving my day :)

On Tue, Feb 24, 2015 at 6:55 PM, Paul DeBruicker <[hidden email]> wrote:

Does JQAjax>>#callback:value: & friends do what you need?

e.g.

html anchor
     url:'#';
     onClick:(html jQuery ajax callback:[:val | self processValueFromPage:
val] value:(html jQuery id:'myDiv') data);
     with:'send data to server'





laura wrote
> Hi all,
>
> I want the following to occur to when an anchor (with href set to
> ‘javascript:{}’, the issue is that the page shouldn't  be re-renderer) is
> clicked
> 1°find some information on the rendered html page
> 2°send it back from client side
> jQuery allows me to make scripts for both steps (for 1° query methods, for
> 2° #callback:). My problem is i don't know how to bind these two steps in
> a
> single script, since from what i know i can't add and asign to a smalltalk
> temp inside a script and i can't perform queries from within a callback
> block (cause the html renderer no longer exists). So, how do i add a temp
> variable inside the script and how i merge the 3 resulting "step" scripts
> into one?
>
> Love,
> Laura
>
> _______________________________________________
> seaside mailing list

> seaside@.squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
View this message in context: http://forum.world.st/Pass-jQuery-result-to-callback-tp4807374p4807413.html
Sent from the Seaside General mailing list archive at Nabble.com.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside