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.

1,330 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
17
votes
0answers
215 views

Replacing SOD with fetch (handling JS library dependencies - *in the future*)

Anticipating a future, I am experimenting with User Custom Actions in the new Document Library View Microsoft has so kindly provided to the First Release Office365 tenants. Since there is almost ...
11
votes
1answer
384 views

socialManager.isFollowed(socialActor) only returning 0 or false, but never true

Any ideas why I'm only getting 0 or false, but never true for result.get_value()? // Set IsFollowed correctly. var clientContext = SP.ClientContext.get_current(); var socialManager = new SP.Social....
10
votes
0answers
621 views

Bundle SharePoint JavaScript files inside SharePoint hosted app

We have a SharePoint hosted app. This app require some scripts from SharePoint; MicrosoftAjax.js, init.js, sp.runtime.js, sp.js, sp.taxonomy.js and sp.workflowservices.js. We load all these from /...
8
votes
1answer
370 views

Retrive & Display a PDF document from SharePoint Document Library to a html canvas using Javascript

In SharePoint hosted App I need to get a specific PDF document from SharePoint Document Library & display its 1st page to a HTML canvas using JavaScript. For that, I tried to retrieve the PDF ...
8
votes
0answers
3k views

How to stop a SharePoint workflow using JSOM

Let me preface by saying that I'm a relative newbie to this SharePoint stuff and am still fumbling my way around a bit learning from code examples where necessary. That being said, I have no issue ...
7
votes
1answer
4k views

How to authenticate user in SharePoint Online using rest api

I have a website on SharePoint Online and a website on SharePoint On-premise. From my On-premise website i want to create a new list on my SharePoint Online site. To authenticate I used the following ...
6
votes
1answer
156 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
77 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
401 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
4k views

How can I populate a dropdown with a SP list?

I have a SP List with data that I need to be in a dropdown list. I also need these to have specific classes. I'm trying something like the following but having no luck: $().SPServices({ ...
5
votes
2answers
925 views

REST API ItemCount on oData BCS List

I have a list generated from a BCS oData provider and I am attempting to get the number of items in the list so I can generate a $top on my request rather than bring back only the 100 item generic ...
4
votes
1answer
85 views

Get SubFolders using Sharepoint REST API and show them in HTML DIV

I want to retrieve Subfolders using SP REST API and check if there is any created folder and If it exists, display HTML content like: <label>SubFolder Title</label> for each SubFolder. All ...
4
votes
1answer
370 views

Print Files through SPFx/JS?

I would like to build a button which would send a batch of files to the printer when clicked (It can prompt the user. Doesn't need to go to the printer without approval). The files would exist in a ...
4
votes
0answers
642 views

Sharepoint, Chart.JS and multiple charts not working

I'm relatively new to Sharepoint and am having a rather annoying issue. I am using Sharepoint 2013 and I am creating 3 donut charts all to be displayed on the same page, using chart.js. I have three ...
4
votes
1answer
799 views

401 (Unauthorized) in Google Chrome

When I Get the document list from SharePoint site I get this error "401 (Unauthorized)" only in Google Chrome, but in IE it works. This is my code function GetListItems() { var siteURL = "http://...
4
votes
2answers
2k views

Use JSOM to get unique permissions for a folder in document library

I would like to be able to retrieve the permissions for specific folders in a document library via JSOM. Specifically, I would like to be able to use JS to determine if the active folder that the user ...
4
votes
0answers
590 views

SP.WebProxy.invoke Alternative

I'm working on a SharePoint 2013 on premises Hosted App. The app needs to get data from an external REST endpoint from a web service on another computer. I've managed to get in Javascript the SP....
4
votes
1answer
446 views

How to call external ADFS secured WCF Service within Sharepoint via Javascript in an ADFS environment?

Previously on our little Sharepoint environment: We used integrated windows authentication for everything. On some of our sharepoint sites we integrated some custom javascript application logic that ...
4
votes
1answer
739 views

SharePoint Workflow Subscription Service failed

I have one requirement to start the SP workflow through JavaScript. For this, I have wrote some lines of code to start the workflow. But I am getting a Subscription failed error due to undefined ...
4
votes
3answers
7k views

How to check if a list item exists or not in SharePoint 2013 using javascript

I have created one custom form and insert data into one list.I want to check before data insert into the list if the data exists in list or not .
4
votes
3answers
1k views

Add showWaitScreenWithNoClose to SPServices GetListItems

With a button on page which calls the function createListItems() which is added to the page as a link in a CEWP. The function takes 10-25 seconds to complete (get items from one list and add them to ...
3
votes
0answers
174 views

Add UserCustomAction (ECB) for a group of checked items

I've found many code examples online showing how to add a User Custom Action to ECB from JavaScript. Take this one, for example. I've adapted and used the code, and it successfully adds a menu item ...
3
votes
0answers
58 views

How to work with JSOM typed-objects

This is a stumbling block that I keep hitting over and over again. Any advice or tips would be very helpful. I prefer to use the SP REST api to accomplish all kinds of things on our site, but for ...
3
votes
1answer
359 views

SharePoint 2010 JavaScript CSOM- Updating list item by id - Anonymous user - Access denied

I am using SharePoint 2010 JavaScript Client Side Object Model to create and update list items on a SharePoint Survey list. In my use case users are anonymous . New items are created properly (...
3
votes
0answers
27 views

Disable field when current user isn't line manager

I've been searching for a couple of hours now and not found anything useful or that fully answers my query. I have a new approval process for holidays but I need some assistance locking down the ...
3
votes
3answers
2k views

Conditional formatting for SharePoint Online column.

I am working on a SharePoint Online 2016 site collection and need to add conditional formatting to a few drop down fields. The drop down options are: 1: Red, 2: Amber, 3: Green. I want the field in ...
3
votes
1answer
67 views

Inject javascript to a list without using third programs -Sharepoint online

I have a simple form like this: I want to know, how can I import some javascript function to that list?
3
votes
0answers
52 views

Interact with SharePoint Web Part Programmatically from JavaScript

My colleague is attempting to write a SharePoint add-in that interacts with a web part in SharePoint. Specifically the project schedule add-in. We have all of the basic business logic implemented, ...
3
votes
0answers
236 views

How to render sharepoint 2013 rest api data into a list/library view with javascript?

I am downloading data from a sharepoint 2013 library and custom list, using the rest API (with CAML query), and I get back JSON data. Is there a javascript library out there that can take that JSON ...
3
votes
0answers
572 views

Search the document library using rest api in Sharepoint including its content

I dont require sharepoint search answers.I require using JS/Json/Web service/rest api.If i type anything in search box in top nav it should go to another page and show the results.Is there any way to ...
3
votes
1answer
188 views

SharePoint 2013 : Calling function in javascript file from Ribbon button

I am trying to call a function in an external javascript file from SharePoint 2013 ribbon button. I have a Typescript file and i am using Webpack to transcompile it to javascript. When i try to call ...
3
votes
0answers
47 views

Build url of publishing page by lookup id

Got a list with a LookupField to Publishing Pages library pointing on "Title" and additional field "ID". I would like to create a hyperlink by CSOM / javascript without querying FileRef on pages ...
3
votes
1answer
1k views

How can I get an image map to highlight various parts with mouse hover?

I am using SharePoint 2010 and I'm trying to use javascript and html to create an image map that highlights different sections of the image depending on where the cursor hovers over. In this case I'm ...
3
votes
0answers
591 views

How to split the form into tabs in sharepoint 2013

I am trying to split a SharePoint 2013 list form into multiple tabs. I have tried below code but it is throwing an error "Unable to get property 'substring' of undefined or null reference". PFB my ...
3
votes
1answer
241 views

Warning Pop-Up Window Before Saving

I do not know which way to turn. The scenario is that I have created a SharePoint List with a InfoPath form attached to the list. There are numerous individuals that will be touching the form per ...
3
votes
0answers
123 views

Undefined error querying a sharepoint list

I have two lists CharitySlots and CharityBooking.CharityBooking has a lookup field into CharitySlots. CharitySlots has a Lookup (calculated field) to count the number of slots taken. I run an event ...
3
votes
1answer
515 views

Using the sharepoint javascript library (sp.js)

I created a form with HTML and JS for which the ultimate aim is to store data in a SharePoint list when the Submit button is clicked. For some reason, the code does not work when I embed it inside an ...
3
votes
0answers
455 views

Working with Discussions/Replies using REST update DiscussionLastUpdated

I'm following this thread which shows how to create a reply to a discussion using REST api. Basically -- created the reply at top level of list, get the reply parent folder, get the FileRef info about ...
3
votes
3answers
78 views

get a value out of a function?

I am trying to get value out of java script function to a variable var isMember; IsCurrentUserMemberOfGroup("Team Management System Members", function (isCurrentUserInGroup) {...
3
votes
1answer
64 views

Process memory usage is rising to 1.8GB - Is there a more efficient way to write?

I am reading the content of a file and writing it to a SharePoint external List(SQL). There is around 35000 lines in the file. I am receiving the error below in SharePoint and process memory usage is ...
3
votes
2answers
177 views

How can I edit web part in SharePoint 2013 on premises

I have tried most of the suggestion I found on the searches and still can't edit the web part. I don't want to delete the entire web part as multiple users access the site daily. The problem is that ...
3
votes
0answers
399 views

How do I add the approve/reject button to the DisplayForm.aspx on a SharePoint 2013 task?

Hi I am attempting to add the approve/reject button to the DisplayForm.aspx (and possibly other forms) on a SharePoint 2013 task. I have a custom SP 2013 workflow designed for streamlining an ...
3
votes
0answers
104 views

adding links to PictureLibrarySlideshowWebPart and opening it on the same tab/page

I'm using the code on page, <WebPartPages:PictureLibrarySlideshowWebPart adding links, for adding the link to the slideshow pic webpart but I'd like to open the link in the same tab/window. Is it ...
3
votes
0answers
691 views

How to enable cors on a different site collection?

I want to make a rest call to get web properties (i.e. /_api/web), for a different web application than the current. I have added the response headers Access-Control-Allow-Credentials : true Access-...
3
votes
1answer
194 views

New Item script does not apply after postback

I have a simple javascript code on a new item page, it limits the number of characters for a multi-line field. After I select someone in the people picker, the form does a quick postback and load, and ...
3
votes
0answers
278 views

Uploading Large PDF Files in Sharepoint Library

I want to upload large PDF Files in a Sharepoint Library . I tried from normal code from GetFolderByServerRelativeUrl method and it is working fine , but taking too much time.(for ex. a PDF of size ...
3
votes
1answer
816 views

Filter sharepoint list using multi line text field

I'm trying to filter a sharepoint list using ajax api. So one of the filtered field is Multi line text field (FieldType.Note) , after performing request it throws an error telleing that the field ...