Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

6
votes
2answers
898 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
2k views

SPFx Replacement for Script Editor Web Part

So I was having a play around with the new Modern Experience site pages and while it's pretty slick and looks great (as well as fixing the issues with container layouts being a royal pain to change ...
5
votes
2answers
6k views

How can I get information about a term through JavaScript?

What I want to do is something like: var myTerm = getTermInfo(55c6801f-78b3-485f-b811-530bec1961e9);
5
votes
2answers
2k views

View custom field property value using JavaScript

I'm using SharePoint 2010. Need to retrieve the Custom field property values using a JavaScript. [Trying to do this during item click in the SharePoint list item view. I call the JavaScript on the ...
5
votes
1answer
9k views

SP2010 Javascript REST API: updating list item using MERGE and POST

I am trying to use REST API approach in javascript to update a sharepoint list item where I have an id. So I use GET and POST to create records, but per MSDN article it looks like the way to do this ...
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 ...
4
votes
6answers
24k views

SP.UI.ModalDialog.RefreshPage from the dialog itself?

I have customized the display form on one of my list. On a webpart page, I have drop a view to this list. When I click on the title of my item, the custom disp form is shown as expected in a modal ...
4
votes
2answers
3k views

Check if logged in user is member of AD group with ECMA script SharePoint 2013

There is active directory group added to SharePoint group. How would we can check that the logged in user is member of that active directory group using ECMA script?
4
votes
3answers
6k views

SP2013 javascript client object model - get server time

My client machine and server machine has time offset of 2:30 hours. So when I try to retrieve Date/Time field using JSOM, it gives time according to offset. oListItem.get_item("Modified"); So how to ...
4
votes
1answer
4k views

REST Add List Item of Custom Content Type

In my SharePoint add-in, I have already utilized the REST call for creating a new list item: $.ajax({ url: "../_api/web/lists/getbytitle('Example List')/items", method: "POST", ...
4
votes
3answers
23k views

Get list items created by logged in user with REST api

How can I get all list items created or changed by the currently logged in user with this function? What's the correct query? // Getting list items based on ODATA Query function getListItems(url, ...
4
votes
2answers
5k views

Add Back Button to Survey List in SharePoint 2013

In Survey, people can respond all the questions sequentially within one page or Add branching logic to answer one by one like wizards. Please refer the Image After creating survey with ...
4
votes
2answers
11k views

Refresh the data on the webpart without entire Page refresh

The data from the list is displayed on the page using content editor webpart as a scrolling text. The requirement is whenever the list is updated with new items, the data displayed on the page using ...
4
votes
1answer
4k views

news ticker tape on sharepoint list SP 2013

At the top of my sharepoint list view, I am wanting to add in a vertical news ticker feed, similar to this: http://risq.github.io/jquery-advanced-news-ticker/ I have tried four approaches so far ...
4
votes
2answers
9k views

How to get web part id

This is a follow up question to the one i asked earlier : Reading web part properties using javascript object model In my earlier question I had been able to access the properties using jsom but i am ...
3
votes
4answers
1k views

what is the best way to host a BING map inside a page on Sharepoint 2010 Farm Solution?

I'm new to SharePoint, and could really use some advice: what is the best way to host a BING map inside Sharepoint ? The task I have is: to host a bing map inside a Sharepoint 2010 Farm Solution. We ...
3
votes
1answer
2k views

List view filter callback

Is there a way to catch the event fired alter filtering a list view webpart? (fintere using the default filter) I need to get the items in the view after a filter has been applied. Is there a sort of ...
3
votes
3answers
3k views

Can't get People Picker value on 'Edit' form load

When opening a SharePoint EDIT form, I'm trying to capture a people picker value using JavaScript. Unfortunately, the people picker isn't loaded with data when I call .GetAllUserInfo. I'm using the ...
3
votes
1answer
4k views

How to get only the first x items starting at position y from a list, using CAML query?

In sharepoint 2010 client object model in javascript, I want to create a caml query, that can download items from a list. I have this part working, but I want to download only x items, not the whole ...
3
votes
2answers
14k views

Using Sharepoint client API to upload file as attachment in javascript

is there a way to upload file as attachment while using JavaScript client object model in sharepoint 2013? Or using web service in the middle is required? I cannot use FileAPI from HTML5. Thank you ...
3
votes
1answer
3k views

Getting date and time from SharePoint Server 2007 and throw it to Javascript variable

How to I get the date and time from SharePoint Server 2007 and pass this value as a Javascript variable?
3
votes
1answer
14k views

How to get the managed metadata column value in a list client object model

I am trying to get values from a list for different columns like Title ,ID ,Region Where Region is a metadata column . I am able to get all the values except metadata column values . Pleas tell me ...
3
votes
3answers
8k views

using CSOM to retrieve fields in a list in a view

I am trying to use the CSOM to retrieve all the displayed fields in a particular view. I require to know the field type and field internal name. I can not do: var list = hostWebContext.get_web()....
2
votes
4answers
5k views

Hide weekend in calendar SharePoint 2013

I need to hide weekend in calendar SharePoint 2013. And I can hide the columns Saturday and Sunday. But I have some problems in my calendar view. The button "Add" disappears in the columns Friday. I ...
2
votes
2answers
5k views

Is it possible to refer to a field hidden in current view from JSLink attached to current view?

I have the following JavaScript code attached to List's JSLink property: (function () { var coloringFieldContext = {}; coloringFieldContext.Templates = {}; coloringFieldContext....
2
votes
1answer
2k views

Refresh page or call JS function after New Item dialog closes

I have a link when clicked, shows the New Item dialog. When the user clicks 'Save', the list item is added. Is there a way to attach the dialog's onClose event to another piece of code? Or can I ...
2
votes
2answers
13k views

How do I get my JS to work on sharepoint online?

I'm trying to run a simple script on a document library on a team site. I'm quite new to doing anything with sharepoint other than using OOTB features, so forgive me if this is a painfully simple ...
2
votes
1answer
3k views

Hidding Forms; fields using standard jquery versus using JSlink. which approach is better

I want to hide some fields from my Edit & New forms, and i need this to apply to all the subsites. now if i hide the columns from the Content type they will appear again when users modify these ...
2
votes
3answers
5k views

How to Create Piechart in sharepoint 2010 Based on the List item Values? Only using Javascript/jquery

I have a CustomList in Sharepoint 2010 as Mentioned Below.have two columns Team and Values of Team List A Team ValuesofTeam A 9 A 6 B 7 C ...
1
vote
2answers
9k views

Attachment Upload using SPServices and Not the JS File API

I am trying to figure out how to use the SPServices JS library to upload a file without using the HTML5 JavaScript file API. This is specifically targeting IE9. I have a solution that works with all ...
1
vote
3answers
13k views

How to get user security group name through javascript

I use the following code in javascript to display name of logged in user. SP.SOD.executeFunc('sp.js', 'SP.ClientContext', getUserData); Is there a code that will also tell me security group of ...
1
vote
4answers
3k views

Zip document library using JSzip

How do I zip and download all the files (keeping the folder structure) from a document library using Jsom and jzip Library? Download multiple files then compress to one zip file using JSZip & ...
1
vote
2answers
1k views

Use javascript/jquery to see if items in list are due soon in Sharepoint 2013

I am trying to determine by date if an item is due. In my use case, my user will create an item with a date in the following format (MM/DD or 06/15). Now if the date the user chooses will fall in the ...
1
vote
2answers
1k views

How to include a 'yes' and 'no' button on the PreSaveAction() on the EditForm.aspx to return true/false accordingly?

I am simply looking to use the PreSaveAction() in a content editor web part as an extra cautionary step prior to saving a list item. Here is what I have: function PreSaveAction() { alert('Are ...
0
votes
4answers
4k views

How to get the list item column values based on the html drop down and display in the alert box using Javascript?

I have a html dropdown list(team name) which contains three values A,B,C I have a sharepoint 2010 List A which contains Team name and Email. List A Teamname Email A A@test.com B ...
0
votes
3answers
10k views

Save data into SharePoint list from HTML text box (using JS)

I have made a Text box and a save button. when I write something in text box and click save button, I need to save this data every time in the list. How can I do this using Java Script? Data should ...
0
votes
2answers
636 views

Should we consolidate all form customization javascript into one file?

On the project I am working on (SP2013 on-premise), almost all the form pages (Newform.aspx, DispForm.aspx and Editform.aspx) have added a Script editor webpart with JQuery to customize form layout (e....
10
votes
3answers
20k views

Get a value included from a lookup column using the JavaScript Client Object Model

Related: How to retrieve a ListItem using the Javascript Client Object Model? In my previous question I was able to successfully retrieve a basic value from a list item. My problem is that I am now ...
10
votes
1answer
8k views

no sorting with JavaScript Client Object Model?

I have the following JSOM code: var query = "<View><Query><Where><Eq><FieldRef Name='Category'/><Value Type='Choice'>ValueA</Value></Eq></Where>&...
8
votes
2answers
5k views

Sharepoint REST service

Is there any way of reading the documents names of a Document Library using JavaScript from a web application that is not hosted in SharePoint? by the way, my requirement if for SharePoint 2010 not ...
8
votes
2answers
2k views

What are the Type.registerNamespace advantages over standard JavaScript methods?

Now I dive deeper into the world of .Net developers I notice more and more Microsoft ways of doing things unfamilair to me as a (once LiveScript) JavaScript developer. I see PnP and other blogs using:...
7
votes
3answers
9k views

How to get file or list item icon in SharePoint 2013 using javascript

My requirement is i have to display files from document library with images using javascript object model or spservices. pls let me now is there a way.
7
votes
2answers
2k views

CSOM Search API does not return all the results

I am having a problem with the code below. It is not returning all the rows/items which are found in different lists. The total number of items is 28, but the code below is returning 19. I have set ...
6
votes
4answers
22k views

Undefined SP.ClientContext

I always get undefined on my SP.ClientContext.get_current() I have tried with this code: SP.SOD.executeFunc('sp.js','SP.ClientContext',runthiscode); function runthiscode(){ SP.SOD.executeFunc('SP....
6
votes
2answers
2k views

Null Reference Type Error using Javascript in Sharepoint 2013

Having an issue with javascript in sharepoint 2013. We have set up javascript and it is working by changing the colours of the rows in a task list. The issue is when the user goes into quick edit, and ...
5
votes
5answers
3k views

Include JavaScript in a feature

I remember seeing somewhere that you can include an external JavaScript file in a SharePoint feature if it is in the _layouts folder. For the life of me I can't remember how to do this!
5
votes
2answers
4k views

CSR is also applied to a Group By header in a ListView

The only decent blogs mentioning CSR and Grouping are: http://www.codeproject.com/Articles/620110/SharePoint-Client-Side-Rendering-List-Views (must read) http://jsuhail.blogspot.nl/2014/09/client-...
5
votes
4answers
19k views

Get SharePoint user id from login name

I need to retrieve current user id from login name. How can that be done? I have used the following code: var userid=Function??("domain\name");
5
votes
3answers
8k views

Start Workflow using JavaScript or Ribbon Button

I'm using SharePoint 2010 Foundation. I've developed a SharePoint-Farm Solution and now I want start a SharePoint Workflow clicking a Ribbon Button. I know that with SharePoint Designer I can create ...
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 ...