Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have added terms in termset and need to loopthrough the terms in javascript to get the array of terms. so i used spservice. but not working

 function GetTerm() {
   var termStore = document.getElementById('<%=TermStoreID.ClientID=%>').value.toString();
    var termSet = document.getElementById('<%=TermSetID.ClientID %>').value.toString();
    var name = new Array();
   var index = 0;
    $().SPServices({
        operation: "GetChildTermsInTermSet",
        sspId: termStore,
        lcid: 1033,
        termSetId: termSet,
        completefunc: function (xData, Status) {
           alert("ok");
        }
    });
    return name;
}

not even the alert message is displaying

share|improve this question
    
what are you trying to do? There might be better solutions... –  Anders Rask Apr 25 '12 at 11:02
    
i need to get the terms in the term set and store in array. –  yogesh Apr 25 '12 at 13:46
    
Are you certain the termStore and termSet variables comes back with the correct guid? –  JohnnyT Apr 25 '12 at 13:59
    
the guid is correct but the service is not triggerring. –  yogesh Apr 25 '12 at 14:27

1 Answer 1

From the sounds of it, you need to do some debugging. If "the service is not triggerring", there is likely an error of some sort.

First check to make sure your references to jQuery and SPServices are correct (this causes a suprising majority of first time issues). See my post Adding jQuery+SPServices to a SharePoint Page: Step One, Always.

Assuming that your references are good, add alert(xData.responseText); in the completefunc to see what's returned from the Web Service call.

M.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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