Questions tagged [javascript]

Javascript is a dynamic computer programming language, most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed.

Filter by
Sorted by
Tagged with
6
votes
5answers
19k views

Retrieve All list items with AngularJS and ClientContext

I would like to ask you if there is a possibility to use ClientContext with AngularJS? In this way I want to take all items, sort them, filter, make some modification and etc. Later maybe I will add ...
6
votes
1answer
3k views

SharePoint and Javascript - Get content types for list

I have been using the JSOM with SharePoint 2013 and am trying to get the content types of a list to iterate through, and am having no luck. First, while the success handler is being reached, the ...
6
votes
3answers
2k views

How can i add a custom tab to a ribbon at runtime using javascript/ECMAscript?

I'm trying to add a Custom tab with a group and some buttons to a single client via conditional javascript, as far as i can tell this is all found in the CUI namespace, however documentation is hard ...
6
votes
1answer
2k views

Get and remove all currently displayed notifications from SP.UI.Notify

I am sending a variety of notifications via SP.UI.Notify.addNotification("blah", true); setting the "sticky bit" to true so that the notification stays visible. When I display a second ...
6
votes
1answer
150 views

Can i eliminate duplicate items which have the same (Title & Created-by) from the list view Count

I am working on a custom list inside our SharePoint on-premises 2013. i created the custom list to store the users who access a discussion board items, by following this approach:- 1- Inside the ...
6
votes
3answers
7k views

Query Membership of Active Directory Group in Security Group in Sharepoint

I have a Sharepoint group, and within this group, is an Active Directory group. I want to know if I can send a query to find if the current user is a member of the AD group, from Javascript. I do ...
6
votes
2answers
1k views

Can we unlock a ShortTerm lock via CSOM for SP2013

We are using SP2013 with OWA installed. Users often complain about a file stored in SharePiont being locked by another user not in office. Error is "The file "xxxx" is locked for exclusive use by ...
6
votes
1answer
562 views

How to load the list items in a GridView when scrolled C#

How to develop a VisualWebPart that loads list items on demand when scrolling the GridView, because I have a list with more than 10000 items and performance is key for this application. Description: ...
6
votes
1answer
9k views

Using SharePoint 2013 Cross-Domain Library in a simple web page: is it possible?

I have a web page hosted on a server, say at http://SVR1/path/index.html, and I would like to access some list items in a on-premises SharePoint site hosted on another server, say at http://SVR2/sites/...
6
votes
1answer
166 views

SharePoint 2010 list Item Query

We have a big list in SharePoint 2010. I'm gonna query SharePoint 2010 list item in the web part based on country. I used CAML and JS. I have got errors in different browser" Internet explorer says ...
6
votes
0answers
78 views

SharePoint sometimes adds script in page without any reason

I have this weird problem on one of our customer's SharePoint (2010): sometimes, on different pages, the page came out broken, with a bunch of HTML and scripts inside the normal page. I started ...
6
votes
0answers
445 views

SP's JavaScript function to create pagination

SharePoint 2013 here. I need to create a pagination of results I get from an external web service. I want to use the look and feel of SharePoints pagination: Ideally I could call SharePoint's ...
6
votes
0answers
2k views

'Permission denied' javascript error on modal window opening in IE8

While opening any modal window (NewForm, EditForm, custom or OOTB) on a SharePoint list in Internet Explorer I get few SCRIPT70: Permission denied errors. This causes problem with saving the ...
6
votes
1answer
2k views

SPServices Autocomplete and dynamic CAML query

I have two Text filter web parts (Project and Customer Name) with Apply Filters button for one list. There is a SPServices.SPAutocomplete on each and it works great. Now, I want to show the values in ...
6
votes
1answer
4k views

Getting Version History and What Field has Changed

I am using the GetVersionCollection to get the history information from my list. This seems to be working fine; however, what I need to do is get the version history of the individual item which has ...
5
votes
2answers
9k views

How to refresh page after closing dialog form SharePoint 2013?

I have created a dialog with the following code: function Dialog() { var options = { url: 'http://mysite/mypage.aspx', title: 'My Title', allowMaximize: false, showClose: true, ...
5
votes
5answers
856 views

How can I include jQuery and JavaScript code without straying from the site template?

I've added my JavaScript code by including the script links in the PlaceHolderAdditionalPageHead <asp:Content> tag. Including this has caused a yellow warning stating The current page has ...
5
votes
4answers
20k views

Caml Query to return items created by logged in user

Using Javascript CSOM and want to return items created by logged in user, but the code below returns all items. Could someone advise? var camlQuery = new SP.CamlQuery(); var specifier = "<Eq>&...
5
votes
3answers
22k views

How to update multiple items in sharepoint list online using javascript

I want to update 4 items in the same time in my SharePoint custom list using JavaScript. I am using a CAML query to get the item witch I want to update. Can anybody please help me and write a function ...
5
votes
5answers
15k views

Is there a way to get current item Id in Edit form

I open a list item for editing and want to execute some JavaScript for this but I can't retrieve the item Id in the Edit form. I use following code: var context = SP.ClientContext.get_current(); var ...
5
votes
4answers
12k views

Multiple Values in CAML query from Array? SharePoint 2010 using jQuery/SPServices

So if I use SPServices to GetListItems with CAMLQuery, is it possible to insert multiple values inside Value Type='Number'> here I would like to evaluate things throught a flow in my page, add to an ...
5
votes
7answers
46k views

Get a SharePoint ListItem ID from a List where the 'Title' field is a specific value in JavaScript

I am trying to extract the ListItem ID of a List which I am currently NOT in based on a field value in that List. I cant find anything that explains how to do this. So, to explain. I have a Custom ...
5
votes
7answers
19k views

Set default value in people picker javascript/jquery

I want to set current logged in user to people picker by javascript. I can retrieve the value of user(lets say in var user).But how to set it to people control. Any help is much appreciated.
5
votes
4answers
10k views

Get current web url in a SPRibbon Custom Action Command

I've a SPRibbon custom action with the purpose of open an custom app page in a modal dialog, but I'm getting troubles for getting the current web URL, as well, set a reference for a .js with the right ...
5
votes
3answers
2k views

Sharepoint 2013 - List of Site Collection Administrator (JavaScript)

SharePoint 2013 On-Premises. I have a need to display Site Collection Administrators somewhere on the main page. To test this out, I have written a JavaScript for fetching user data of a website, ...
5
votes
3answers
4k views

Remove item from ECB in sharepoint 2013

I am currently trying to write javascript within a script editor to hide the 'View Properties' and 'Edit Properties' items in the ECB. I have found many solutions that edit the core.js file. However, ...
5
votes
2answers
668 views

Create modern team site in SPFx

I found some articles which are explaining creating modern sites with CSOM. But I am not able to find in JavaScript to use in SPFx. Creating modern sites is supported with SPFx? Any PnP extension ...
5
votes
2answers
34k views

how to call executeQueryAsync() to behave synchronously?

Items are saved in jumbled bcoz I am using executeQueryAsync().How to make executeQueryAsync() behave synchronously?
5
votes
5answers
18k views

SP.ClientContext is not a Constructor

I keep receiving the error message "SP.ClientContext is not a Constructor" every time I try to use it in my JS code. After doing a bit of research online, I found SP.SOD.execute function(). However, I ...
5
votes
2answers
1k views

SP 2010 JavaScript events

I want to hook into certain events on a SharePoint 2010 site, specifically the modal dialog open and close events. Does SharePoint 2010 trigger any events for these kinds of actions? If so, how do I ...
5
votes
2answers
5k views

Get multiple list items by respective IDs - Javascript object model / REST API

I am developing a custom ribbon action as Sharepoint hosted app, where the user can select any number of list items and click on the action. On click of the ribbon action, the app redirects to the app ...
5
votes
1answer
8k views

Javascript : How to handle version conflict errors when using javascript COM?

so I use quite a bit of the javascript client object model for CRUD operations to lists from custom pages (inputs) and I have found that I get version conflict errors on saves from time to time....its ...
5
votes
2answers
2k views

jQuery CDN reference in SP Online MasterPage changed magically

My custom MasterPage deployed to SharePoint Online contains two links to JavaScript libraries on CDN's. Like this: <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js">&...
5
votes
2answers
10k views

SharePoint 2013 get user groups by CSOM

I wrote some code to get the current user groups by CSOM. function getCurrentUser() { this.clientContext = new SP.ClientContext.get_current(); this.oWeb = clientContext.get_web(); ...
5
votes
3answers
24k views

How to access list in SharePoint Hosted App?

I want to create an Sharepoint hosted app but how to access list in these App ??
5
votes
3answers
6k views

Set SP.UI.Status or SP.UI.Notify at PostBack

I use in my web part a Session[""] and would like to notify the user when the session is expired. I check at the PostBack event if the session is already okay, if not, I will execute a JS function ...
5
votes
1answer
1k views

How do I get the ID of the current Discussion Item using Javascript?

How can I dynamically get the ID of the current discussion thread in javascript? Currently, I have the following code: function submitReply() { var ctx = new SP.ClientContext.get_current(); ...
5
votes
3answers
5k views

Run JavaScript after “group by” in list has been clicked on and list data loaded

I have created a JavaScript function to take a url from a list item and turn it into an image. This function works great on a list that doesn't have group by setup. With this script the images will ...
5
votes
3answers
49k views

Why does jquery's document.ready not fire?

In my master page, I have attached jQuery along with my own custom.js. I use the javascript in that file to run fixes on my pages such as style adjustments. Now, when I run simple functions on my ...
5
votes
8answers
35k views

How can we get Cascading Lookup Columns in sharepoint 2010?

How to get the cascaded Lookup columns in sharepoint 2010,Iam having requirement like i have two lists(Category List and Sub category list)..For each item in category list i have 5 different items ...
5
votes
3answers
676 views

Responsive content to list view width in SharePoint 2013

When I change the width of a SharePoint list to a certain amount of Pixels, I have the problem that some content of the list gets cut off on the right side - see the following Screenshot: Is there ...
5
votes
2answers
4k views

window.scrollTo is not working in SharePoint Office 365

I am trying to scroll to top of the page using Javascript I tried the below code window.scrollTo(0,0) This works in all the other tabs (in chrome browser), except the tab which had office 365 page ...
5
votes
1answer
461 views

Column Validation Settings for a mandatory choice

I have a SharePoint 2013 list with 3 dropdowns of which 1 must be selected. It doesn't matter which is selected as long as one of them has data. I tried to do the Validation Settings: =IF(AND(...
5
votes
1answer
3k views

Unable to Save List item after using PreSaveAction() function in NewForm.aspx page

as per my requirements Check current user is present in manager group If not present Check status columns If status column consist value other than Requested then stop user to Save item so for ...
5
votes
1answer
10k views

Onchange People Picker

I have a problem changing a people picker in a custom form. Need when writing or changing the value in the people picker I know, I'm using javascript using jquery. Already tried using this code: $...
5
votes
2answers
8k views

Get Navigation Term for Current Page in CSOM (JavaScript)

I am trying to get the Local Properties for the Navigation Term that is currently being viewed. For example... If I navigate to http://sp2013/about/team I need to get the Local Custom Properties for ...
5
votes
3answers
5k views

Check an Admin account only using Javascript?

Could anyone suggest a way to use Javascript to check whether or not the logged in user to a SharePoint site is Admin? We need to hide some of the SharePoint's MasterPage ContentPlaceHolders if the ...
5
votes
3answers
26k views

SharePoint COM - SP.ClientContext(siteUrl) - Object doesn't support this action

Using the SharePoint COM to update a list item, but my function is failing. function updateProjectEC(projID, totalEC) { if(totalEC !== 0) { console.log("projID: " + projID); ...
5
votes
2answers
18k views

SPService GetListItems with CAML : can't get example to work

enter code hereI am using an example I found on codeplex of SPServices with CamlQuery to try to get list item values with where clause on the ID. For whatever reason this doesn't seem to work for me; ...
5
votes
4answers
16k views

Closing a modal dialog using a custom form

I am using some JavaScript (Client OM) code to open a dialog. Here's a snippet: function OpenModalForm() { //snip var opt = { url: url, width: 800, height: 600, ...

1
3 4
5
6 7
102