Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

prototype Ajax onComplete

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I have the following:



Is there anyway to pass the redirect variable on to completeSaveArticleRequest?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to replace

completeSaveArticleRequest

with

function(){completeSaveArticleRequest(redirect);}

Not sure if it will work, brain is on vacation at the moment.

Eric
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will I need to pass anything else so that it gets the response object?



Something like that?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you have created a closure with your inline function, it will have access to all the variables in scope for the block in which it is declared including myAjax (but not the this pointer).
[ July 12, 2006: Message edited by: Bear Bibeault ]
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Because you have created a closure with your inline function, it will have access to all the variables in scope for the block in which it is declared including myAjax (but not the this pointer).

[ July 12, 2006: Message edited by: Bear Bibeault ]


Ahh, thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whoops

should be

function(req){completeSaveArticleRequest(req,redirect);}

than do it the way you were saying

Eric
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic