Javascript callback

August 17, 2007 § 3 Comments

What is it?

Callback is an executable code that is passed to other functions as parameter.

Why is it useful?

When doing AJAX stuff it is impossible not to have callbacks. Callbacks are needed because Javascript in a browser is single threaded. Therefore order of execution could be achieved by chaining callbacks.


Definition [Wikipedia]


§ 3 Responses to Javascript callback

  • derekjoe says:

    what settings are required for callback a function defined in javascript and passing json as a parameter to that function.
    I have finished writting both of them but i am not able to pass my script to javascript using callback technique in the url

  • didip says:


    The next step you need to do is to build XmlHttpRequest object.

    With this object you can then send the content of your JSON to your specified URL.

    Hope that helps.

    One more thing, almost all of javascript framework can help you with building XmlHttpRequest task.

    Some examples are Mochikit or MooTools.

  • screwlewse says:

    I think it would be helpful to show some code examples.
    Here is one that creates several ajax requests. (using the next ajax as a callback)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

What’s this?

You are currently reading Javascript callback at RAPD.


%d bloggers like this: