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 does "landing" mean in this context?
Why does the Sun have different day lengths, but not the gas giants?
Problem with TransformedDistribution
Is it safe to use olive oil to clean the ear wax?
Does a 'pending' US visa application constitute a denial?
Calculating Wattage for Resistor in High Frequency Application?
Longest common substring in linear time
Argument list too long when zipping large list of certain files in a folder
Is there a name for this algorithm to calculate the concentration of a mixture of two solutions containing the same solute?
I am looking for the correct translation of love for the phrase "in this sign love"
Why is so much work done on numerical verification of the Riemann Hypothesis?
How do I color the graph in datavisualization?
How to explain what's wrong with this application of the chain rule?
Should I stop contributing to retirement accounts?
Removing files under particular conditions (number of files, file age)
What should you do if you miss a job interview (deliberately)?
MTG Artifact and Enchantment Rulings
What was the exact wording from Ivanhoe of this advice on how to free yourself from slavery?
Redundant comparison & "if" before assignment
A social experiment. What is the worst that can happen?
Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?
Multiplicative persistence
What is Cash Advance APR?
Creepy dinosaur pc game identification
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
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
add a comment |
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
add a comment |
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
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
2013 sharepoint-server javascript content-editor-web-part
asked Mar 19 at 6:25
SupermodeSupermode
1,4211025
1,4211025
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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>
Update:
My test result:
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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>
Update:
My test result:
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
add a comment |
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>
Update:
My test result:
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
add a comment |
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>
Update:
My test result:
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>
Update:
My test result:
edited Mar 21 at 6:58
answered Mar 19 at 7:44
Lee_MSFTLee_MSFT
2,463125
2,463125
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
add a comment |
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
I have tried this still however it is unable to load library
– Supermode
Mar 21 at 6:37
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
Check my test result.
– Lee_MSFT
Mar 21 at 6:58
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Mar 19 at 8:23
Satyajit PaulSatyajit Paul
46329
46329
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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