Tag Info

Hot answers tagged

5

I guess you could always use a site collection token in your URL. ~sitecollection URLs and tokens in SharePoint 2013 If that don't work out for you, this blog post has a lot of great examples when working with masterpages and references. Use Site Url in SharePoint Update Try using a scriptlink instead. I'm unsure if encoding is needed thought. Try to ...


2

In your custom page layout first add path to .js file (put path to src="") and then code. <script src="jquery-1.8.3.min.js">//<![CDATA[ //]]> </script> <script>//<![CDATA[ $(document).ready(function(){ //some code }); //]]> </script> <!--MS:<Publishing:EditModePanel ...


2

If you use file system then during system backup those files will not get backed up. This is the same case with system migration. All files in file system needs to be moved separately. On the other hand if you use libraries then those files will be placed in the content database and will be included in backup as well as system upgrade etc. If you place ...


1

I have corrected your code and here you go $(document).ready(function() { ExecuteOrDelayUntilScriptLoaded(GetDesc, "sp.js"); }); function GetDesc() { context = new SP.ClientContext.get_current(); web = context.get_web(); siteURL=$(location).attr('href'); var titleName=document.title; var mListName= "TestList"; ...


1

Updating a list item in JSOM should be as simple as this: function updateListItem(itemId) { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('My List'); this.oListItem = oList.getItemById(itemId); oListItem.set_item('MyField', 'My Updated Field Value'); oListItem.update(); ...


1

You can also add your scripts in the following section too. <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>


1

Considering you are not interested in the whole document library VS mapped folder discussion, I believe that the main reason for placing branding elements (aka CSS) in the "Styles" mapped folder, instead of the parent, "Layouts" is mainly when you want to use the Themable engine. Whether you want to host your resources in a site or directly reference them ...


1

You can use REST API along with CAML query. First create a CAML query that returns all item where Status equals Approved. <Query> <Where> <Eq> <FieldRef Name="Status" /> <Value Type="Text">Approved</Value> </Eq> </Where> </Query> Now use REST query using ajax. On Success method get the count of ...


1

Parameter names in JavaScript are case-sensitive. According to MSDN, it's dialogReturnValueCallback.


1

I have used below JavaScript function to get login name of current logged in user. While working on this code, it was noticed that get_loginName() function brought i:0#.w|DomainName\asad. So I have used string manipulation to get the desired one i.e. DomainName\asad function getCurrentUser() { try { var clientContext = new ...



Only top voted, non community-wiki answers of a minimum length are eligible