2

In SPServices library, I make a search request using:

$().SPServices({
    operation: "Query",
    queryXml: queryText,
    completefunc: searchComplete
});

function searchComplete(xdata, status) {

}

So this means it will call searchComplete when the search completes. The parameters of searchComplete is xdata and status which the SPServices library gives you. But I want to add some my own parameters to the searchComplete function, how can I add them?

I don't want to create global variables or anything.

Thanks.

1 Answer 1

6

Have you considered something like this?

$().SPServices({
    operation: "Query",
    queryXml: queryText,
    completefunc: function(xdata, status){
       //code to set your variables
       searchComplete(xdata, status, yourVariables);
    }
});

function searchComplete(xdata, status, yourVariables) {

}
2
  • oh, I didn't think of that. That should be able to solve my problem, I'll give that a try.
    – omega
    Commented Jun 23, 2013 at 18:42
  • Very glad I could help. Commented Jun 23, 2013 at 21:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.