the j in ajax: run javascript method on async postack

G

Guest

hey all,
is there a way to run my javascript method on every async postback?

thanks,
rodchar
 
G

Guest

Its not a "postback", its a callback, and that is where your javascript
callback function is specified, depending on what AJAX framework you are
running.
For example, a typical JSON structure returned from an "AJAX" call would
actually invoke your javascript function by itself, passing in the JSON data
as an argument.

Regarding the "j" in AJAX, that's actually the ONLY letter in the acronym
that makes any sense:

A - asynchronous: not all Remote Scripting calls are async.
J - Javascript: yes - all Remote Scripting involves Javascript.
X - Xml: Just about nobody uses XML anymore with AJAX.

I liked it better when it was just called "Remote Scripting". That was 1998.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
 
B

bruce barker

see the Sys.WebForms.PageRequestManager, it has an endRequest event you
can attach your javascript to.

-- bruce (sqlwork.com)
 
G

Guest

Howdy,

From top of my head:


<script type="text/javascript">

var requestManager = Sys.WebForms.PageRequestManager.getInstance();

requestManager.add_initializeRequest(IntializeRequestHandler);
requestManager.add_endRequest(EndRequestHandler);

function IntializeRequestHandler(sender, args)
{
// this function will be called
// before async request is executed

// do soemthing here
}

function EndRequestHandler(sender, args)
{
// this function will be called
// after async request is completed

// do soemthing here
}

</script>

Hope it helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top