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.

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) {

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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