0

When I am calling a JQuery using the ID element in the Div tag, its showing up twice. Is there something I need to do to stop the double showing? Below is my code and under that is the outcome (using jquery-3.3.1.min.js and jquery.SPServices-2014.02.min.js). Thanks:

    $(document).ready(function() {
    
       $().SPServices({
         operation: "GetGroupCollectionFromUser",
         userLoginName: $().SPServices.SPGetCurrentUser(),
         //async: false,
         completefunc: function(xData, Status) {
          switch (true) {
            case $(xData.responseXML).find("Group[Name='1 Awards Members']").length == 1:
              htmlText="1 Awards Members";
              $('#permText').append(htmlText);
              break;
            case $(xData.responseXML).find("Group[Name='2 Awards Members']").length == 1:
              htmlText="2 Awards Members";
              $('#permText').append(htmlText);
              break;
            case $(xData.responseXML).find("Group[Name='awards Owners']").length == 1:
              htmlText="Awards Owners";
              $('#permText').append(htmlText);
              break;
            default:
              alert("Your account has not been granted permissions.");
          }
    //was here, $('#permText).append("Awards Owners");...still duplicates
          }
       });
    
    });

enter image description here

2
  • Actually it can be all three. We have 3 different environments we are supporting
    – adams-j
    Mar 20, 2021 at 17:49
  • Thank you for your input. The screen shot was from office 365, which we were able to use on 2013 and 2010 (some what). So again, to reply to your original post, it can. In regards to wasting time, I apologize for wasting anyone’s time, in particular, yours.
    – adams-j
    Mar 20, 2021 at 20:04

1 Answer 1

0

I Figured it out. Add a web part zone using Designer. Got this from the following:

https://social.msdn.microsoft.com/Forums/en-US/7921de59-0fa1-4fa3-bb16-11d0a64d297f/spservices-and-datatables-loading-twice?forum=sharepointdevelopment

Your Answer

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

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