Referencing javascript library in content editor webpartRegex to Parse Script TagsContent Editor Webpart Javascript IssueJavascript How can I return a value for document.write in CEWP with javascriptJavascript is changing in Content Editor WebPartJavaScript window.location doesn't work in content editor webpartJavascript in CEWP queries a list every time dropdown is changed on NewForm.aspx not workingHow to check if current user belongs to SharePoint groupJavascript iframe isn't running correctlyCascading Dropdown not working with no errorsSPServices does not work in the document library

What do the positive and negative (+/-) transmit and receive pins mean on Ethernet cables?

Mortal danger in mid-grade literature

Is this saw blade faulty?

How to split IPA spelling into syllables

Non-Borel set in arbitrary metric space

Capacitor electron flow

PTIJ: Which Dr. Seuss books should one obtain?

Do I have to take mana from my deck or hand when tapping this card?

Magnifying glass in hyperbolic space

Connection Between Knot Theory and Number Theory

"Marked down as someone wanting to sell shares." What does that mean?

What should be the ideal length of sentences in a blog post for ease of reading?

Offset in split text content

Calculate Pi using Monte Carlo

Extract substring according to regexp with sed or grep

Why didn't Voldemort know what Grindelwald looked like?

Travelling in US for more than 90 days

A seasonal riddle

What can I do if I am asked to learn different programming languages very frequently?

How to test the sharpness of a knife?

Why is participating in the European Parliamentary elections used as a threat?

How do I prevent inappropriate ads from appearing in my game?

What is it called when someone votes for an option that's not their first choice?

New Order #2: Turn My Way



Referencing javascript library in content editor webpart


Regex to Parse Script TagsContent Editor Webpart Javascript IssueJavascript How can I return a value for document.write in CEWP with javascriptJavascript is changing in Content Editor WebPartJavaScript window.location doesn't work in content editor webpartJavascript in CEWP queries a list every time dropdown is changed on NewForm.aspx not workingHow to check if current user belongs to SharePoint groupJavascript iframe isn't running correctlyCascading Dropdown not working with no errorsSPServices does not work in the document library













2















So i have added content editor webpart in NewForm.aspx and reading the code to javascript file called HideFields.ps1. SO the script as below:



HideFields.ps1



 <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript">

$(document).ready(function()

$().SPServices(
operation: "GetGroupCollectionFromUser",
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function(xData, Status)
var xml = xData.responseXML.xml;

//If the current User does belong to the group "Test Group"
if (xml.search('Test Group') == -1)

$('td.ms-formlabel:contains("Description")').parent().hide();




);

);
</script>


The above script work as expected if i reference jquery library and SPService library externally.



What it does not work if i have save the file in the same location of this javascript file (HideFields.ps1).





<script type="text/javascript" language="javascript" src="~siteCollection/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


I tried also this one since the all the files existed in the same location





<script type="text/javascript" language="javascript" src="jquery.SPServices-0.7.1a.min.js"></script>









share|improve this question


























    2















    So i have added content editor webpart in NewForm.aspx and reading the code to javascript file called HideFields.ps1. SO the script as below:



    HideFields.ps1



     <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>
    <script type="text/javascript">

    $(document).ready(function()

    $().SPServices(
    operation: "GetGroupCollectionFromUser",
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
    completefunc: function(xData, Status)
    var xml = xData.responseXML.xml;

    //If the current User does belong to the group "Test Group"
    if (xml.search('Test Group') == -1)

    $('td.ms-formlabel:contains("Description")').parent().hide();




    );

    );
    </script>


    The above script work as expected if i reference jquery library and SPService library externally.



    What it does not work if i have save the file in the same location of this javascript file (HideFields.ps1).





    <script type="text/javascript" language="javascript" src="~siteCollection/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


    I tried also this one since the all the files existed in the same location





    <script type="text/javascript" language="javascript" src="jquery.SPServices-0.7.1a.min.js"></script>









    share|improve this question
























      2












      2








      2








      So i have added content editor webpart in NewForm.aspx and reading the code to javascript file called HideFields.ps1. SO the script as below:



      HideFields.ps1



       <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
      <script type="text/javascript" language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>
      <script type="text/javascript">

      $(document).ready(function()

      $().SPServices(
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function(xData, Status)
      var xml = xData.responseXML.xml;

      //If the current User does belong to the group "Test Group"
      if (xml.search('Test Group') == -1)

      $('td.ms-formlabel:contains("Description")').parent().hide();




      );

      );
      </script>


      The above script work as expected if i reference jquery library and SPService library externally.



      What it does not work if i have save the file in the same location of this javascript file (HideFields.ps1).





      <script type="text/javascript" language="javascript" src="~siteCollection/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


      I tried also this one since the all the files existed in the same location





      <script type="text/javascript" language="javascript" src="jquery.SPServices-0.7.1a.min.js"></script>









      share|improve this question














      So i have added content editor webpart in NewForm.aspx and reading the code to javascript file called HideFields.ps1. SO the script as below:



      HideFields.ps1



       <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
      <script type="text/javascript" language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>
      <script type="text/javascript">

      $(document).ready(function()

      $().SPServices(
      operation: "GetGroupCollectionFromUser",
      userLoginName: $().SPServices.SPGetCurrentUser(),
      async: false,
      completefunc: function(xData, Status)
      var xml = xData.responseXML.xml;

      //If the current User does belong to the group "Test Group"
      if (xml.search('Test Group') == -1)

      $('td.ms-formlabel:contains("Description")').parent().hide();




      );

      );
      </script>


      The above script work as expected if i reference jquery library and SPService library externally.



      What it does not work if i have save the file in the same location of this javascript file (HideFields.ps1).





      <script type="text/javascript" language="javascript" src="~siteCollection/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


      I tried also this one since the all the files existed in the same location





      <script type="text/javascript" language="javascript" src="jquery.SPServices-0.7.1a.min.js"></script>






      2013 sharepoint-server javascript content-editor-web-part






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 21 hours ago









      SupermodeSupermode

      1,4211025




      1,4211025




















          2 Answers
          2






          active

          oldest

          votes


















          3














          If site url like http://sp, reference the library as:



          <script type="text/javascript" language="javascript" src="/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


          If site url like http://sp/sites/team, reference the library as:



          <script type="text/javascript" language="javascript" src="/sites/team/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>





          share|improve this answer






























            0














            Try these 2 options -



            • Place your files in some other custom libraries other than "Site Assets" or "Style Library", and then refer it in your HTML from there.

            • Put your site in trusted locations in Internet Options settings of IE (Settings > Internet Options > Security > Trusted Sites > Sites > Add your site





            share|improve this answer






















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "232"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsharepoint.stackexchange.com%2fquestions%2f259616%2freferencing-javascript-library-in-content-editor-webpart%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              If site url like http://sp, reference the library as:



              <script type="text/javascript" language="javascript" src="/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


              If site url like http://sp/sites/team, reference the library as:



              <script type="text/javascript" language="javascript" src="/sites/team/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>





              share|improve this answer



























                3














                If site url like http://sp, reference the library as:



                <script type="text/javascript" language="javascript" src="/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


                If site url like http://sp/sites/team, reference the library as:



                <script type="text/javascript" language="javascript" src="/sites/team/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>





                share|improve this answer

























                  3












                  3








                  3







                  If site url like http://sp, reference the library as:



                  <script type="text/javascript" language="javascript" src="/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


                  If site url like http://sp/sites/team, reference the library as:



                  <script type="text/javascript" language="javascript" src="/sites/team/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>





                  share|improve this answer













                  If site url like http://sp, reference the library as:



                  <script type="text/javascript" language="javascript" src="/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>


                  If site url like http://sp/sites/team, reference the library as:



                  <script type="text/javascript" language="javascript" src="/sites/team/Style Library/Scripts/jquery.SPServices-0.7.1a.min.js"></script>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 20 hours ago









                  Lee_MSFTLee_MSFT

                  2,453125




                  2,453125























                      0














                      Try these 2 options -



                      • Place your files in some other custom libraries other than "Site Assets" or "Style Library", and then refer it in your HTML from there.

                      • Put your site in trusted locations in Internet Options settings of IE (Settings > Internet Options > Security > Trusted Sites > Sites > Add your site





                      share|improve this answer



























                        0














                        Try these 2 options -



                        • Place your files in some other custom libraries other than "Site Assets" or "Style Library", and then refer it in your HTML from there.

                        • Put your site in trusted locations in Internet Options settings of IE (Settings > Internet Options > Security > Trusted Sites > Sites > Add your site





                        share|improve this answer

























                          0












                          0








                          0







                          Try these 2 options -



                          • Place your files in some other custom libraries other than "Site Assets" or "Style Library", and then refer it in your HTML from there.

                          • Put your site in trusted locations in Internet Options settings of IE (Settings > Internet Options > Security > Trusted Sites > Sites > Add your site





                          share|improve this answer













                          Try these 2 options -



                          • Place your files in some other custom libraries other than "Site Assets" or "Style Library", and then refer it in your HTML from there.

                          • Put your site in trusted locations in Internet Options settings of IE (Settings > Internet Options > Security > Trusted Sites > Sites > Add your site






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 19 hours ago









                          Satyajit PaulSatyajit Paul

                          46329




                          46329



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to SharePoint Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsharepoint.stackexchange.com%2fquestions%2f259616%2freferencing-javascript-library-in-content-editor-webpart%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                              Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                              Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.