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
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 21 hours ago
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>
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>
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>
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>
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>
answered 20 hours ago
Lee_MSFTLee_MSFT
2,453125
2,453125
add a comment |
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 19 hours ago
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