File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes prototype Ajax onComplete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "prototype Ajax onComplete" Watch "prototype Ajax onComplete" New topic
Author

prototype Ajax onComplete

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Say I have the following:



Is there anyway to pass the redirect variable on to completeSaveArticleRequest?


GenRocket - Experts at Building Test Data
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

Will I need to pass anything else so that it gets the response object?



Something like that?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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

Joined: Nov 08, 2001
Posts: 15376
    
    6
whoops

should be

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

than do it the way you were saying

Eric
 
wood burning stoves
 
subject: prototype Ajax onComplete