0

I am using the jQuery Load method.

 $('#tabs-1').load("@Html.Raw(Url.Action("IndexTpUse",
                                    "Transactions"))", completed);

 function completed(response, status, xhr)
 {

 }

What I need is to send an additional parameter from the load method into the completed function. Is it possible?

So that my final result might be something like this:

 function completed(response, status, xhr, additionalParam)
 {

 }

Thanks

4
  • 1
    And where would that additional parameter come from, the serverside ? Commented Jan 9, 2014 at 17:21
  • just wrap completed method inside anonymous function, and pass parameters Commented Jan 9, 2014 at 17:22
  • @adeneo no. I need to send it from the client side .load method. This is a Javascript language doubt I guess. Commented Jan 9, 2014 at 17:30
  • @A.Wolff can you give me an example? Thanks Commented Jan 9, 2014 at 17:31

1 Answer 1

1

You can use bind to predefine some function parameters:

$('#tabs-1').load("@Html.Raw(Url.Action("IndexTpUse","Transactions"))", completed.bind(null, 'my param value'));

 function completed(additionalParam, response, status, xhr)
 {

 }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.