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,495 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
80 views

How do you localize ECB custom actions?

I have created two custom action buttons using javascript but they need to be localized (fr/en). I have server side Resource files and client side ones as well. This is how I'm creating the actions: ...
Batman's user avatar
  • 1,448
2 votes
0 answers
1k views

SP.Utilities.Utility.SendEmail send as plain text

I'm using the SendEmail JavaScript utility and it's working except that I'm getting the email as HTML instead of plain text (which is what I need to process the body correctly for another service). I'...
FolcoTook's user avatar
2 votes
1 answer
331 views

Count checked out files in sharepoint 2010 library using javascript

The checked out files can be reached via the UI by browsing Document library --> settings --> Manage Checked out Files. I would like to do it using the usual "function, success, failed" procedure in ...
ameliapond's user avatar
2 votes
0 answers
195 views

Display Modifications Each Time an Item is Updated

Not sure if this can be accomplished, but I want to try. Objective: When an item is modified SharePoint keeps track of the modification date, time, and person who modified the item. You can see ...
SharePoint Lady's user avatar
2 votes
0 answers
21 views

How does one search a site collection for code embedded in web parts?

When refactoring you have to search your code base to see what areas may be impacted by a changing api. Code that is maintained in .js files and checked into source control can easily be searched. ...
Mario's user avatar
  • 502
2 votes
2 answers
620 views

Countdown html/css/js not working but works in jsfiddle

Is there any reason why this solution won't work in SharePoint? It works well on jsfiddle. I modified the html file to add css and js reference and put the html in a cewp. What am i missing? any help ...
Julie's user avatar
  • 21
2 votes
0 answers
369 views

Unable to change the field type for "People or Group" from the built-in text field to be a drop down list

I have read the following article which shows how to change a "People or Group" field type from text field to be a drop down, which what i am looking for:- https://hyankov.wordpress.com/2015/07/15/...
John John's user avatar
2 votes
0 answers
251 views

Create dynamic view of list item by clicking on tile

I have a "promoted links" list to display some tiles on a page. What I am trying to do now is to display a popup window or a seperate browser window when I click on that tile, based on the list ...
ddominnik's user avatar
2 votes
0 answers
750 views

Type Error: Cannot read property 'push' of null while creating Cascading Dropdowns

I am getting the Type Error: Cannot read property 'push' of null in the SPServices js file while implementing Cascading Dropdowns. I am including the js files jquery-1.10.1.min.js and jquery....
RChand's user avatar
  • 53
2 votes
0 answers
47 views

Site JavaScript optimization with JavaScript compression

I have a site with many webparts created in visual studio, each webpart is referencing a JavaScript file, and I have some pages with 5 or 6 webparts. Whats the best practice to do compression for ...
Jacky's user avatar
  • 319
2 votes
1 answer
238 views

Add same webpart multiple times on a webpage

I have a webpart i need to add multiple times on a webpage, how can I restrict in javascript the the variable to read from each webpart property? In webpart ascx file, I have hidden fields like: &...
Jennifer T's user avatar
2 votes
0 answers
60 views

How to open a default Document library and upload files from it when clicking Choose file option?

How to upload files from default Document Library when clicking on Choose file INPUT control? When clicking on the "Choose file" it should open Document Library, from which I could select documents ...
Madhav's user avatar
  • 1,494
2 votes
1 answer
646 views

SharePoint custom JavaScript and jQuery blocked by MDS Minimal Download Strategy

Here's my setup. Onprem SharePoint 2016. I have a master page which is basically a copy of seattle.master and I want to add jQuery and a custom Javascript to manipulate the DOM. The minimal download ...
SPBogdan's user avatar
2 votes
0 answers
217 views

How to open one EditForm.aspx Page in Classic mode, In a Modern Experience SPOnline env.

I do not want to switch the whole SiteCollection back to Classic. Users are very happy with the Modern Experience I want to open the EditForm in Classic mode only once.. so my UserCustomAction ...
Danny '365CSI' Engelman's user avatar
2 votes
0 answers
34 views

Is it possible to POST to a list that requires OAuth, through just js?

I'm (very) new to SharePoint, and have been tasked with creating what was described as a "lightweight Angular form" to submit items to a list. The form is supposed to be embedded into a page, so it's ...
UrhoKarila's user avatar
2 votes
1 answer
3k views

Grouping SharePoint REST API results

I am building a customized events feed via REST query. I have a feed of all events in the calendar, filtered on date range and sorted, but I'd like to take it a step further and group the results by ...
h3nryyy8's user avatar
2 votes
0 answers
1k views

group by and count in caml

I need to create chart using JavaScript from SharePoint 2010 list data .I am stuck to create data structure. Status: Pending Department: XYZ Number-row:10 Please help me to create caml query ...
user60654's user avatar
2 votes
1 answer
1k views

check if User field value is a user or a group using CSOM/JSOM

I am able to get a user field and its value from a list using CSOM/JSOM. I cannot figure out how to get if the value is a user or a group. ExecuteOrDelayUntilScriptLoaded(function() { var context ...
IMTheNachoMan's user avatar
2 votes
0 answers
48 views

Prevent Visual Studio from Overriding Poject internal SPList

Is there a way to prevent Visual Studio from Overriding Poject internal SPList? And how can I reuse a already created List inside an App? The Lists is not accessible after a new deployment of the app....
Snickbrack's user avatar
2 votes
0 answers
2k views

getting XMLHttpRequest cannot load (URL) Response for preflight is invalid (redirect)

here am trying to get reccurring events from calendar list for sharepoint Online app and there am using code as like hostWebUrl = decodeURIComponent(manageQueryStringParameter('SPHostUrl')); ...
Madhav's user avatar
  • 1,494
2 votes
2 answers
271 views

Unable to get event item time in SharePoint online calender list

I'm writing simple JavaScript. In that script I'm getting Event item Start date field value and End date field value from Custom calendar list. but the code retrieve different time Example: here is ...
Akshay Dattatray Nangare's user avatar
2 votes
0 answers
294 views

Create site collection using jsom

I am wondering if creation of site collections with javascript on SharePoint hosted sites, is still not possible? If not, is it possible to use the site collection creation form _layouts/15/online/...
Lennard's user avatar
  • 31
2 votes
0 answers
141 views

starting JSOM workflows 2013 Invalid request / unauthorised

I have trouble starting workflows with JSOM. The first case causes errors only for some users mostly on Wi-Fi First case is : var servicesManager = new SP.WorkflowServices....
Ondřej Čech's user avatar
2 votes
1 answer
34 views

how to start workflow when list item got added in SharePoint hosted app list

I want to start workflow when list item will be get added into my SharePoint hosted list using javascript?am very new to this.
sharepoint2013's user avatar
2 votes
1 answer
706 views

Resize an Image Before Upload to SharePoint List using REST API

I'm uploading an image to a SharePoint list using the REST API based on documentation here. My function looks like: function uploadFile(FormDigest, FileInput, fileName) { var ...
dikuw's user avatar
  • 502
2 votes
1 answer
545 views

Type is undefined: Javascript error that occurs in new environment but not the old

I am building a new VM for Development. In my Production environment I have a page that throws no errors and works correctly. However, when I try to look at this page in the new VM, I get the error "...
amsackett's user avatar
  • 379
2 votes
2 answers
816 views

Add default value to the site column inside content type using javascript Sharepoint 2013

I am creating some site columns using javascript. And also I am creating content types. I am attaching these site columns to the content type with the <FiedRef> tag. But I want different default ...
Mihir's user avatar
  • 1,546
2 votes
0 answers
39 views

Display Multi-field Checkbox

I have a MultiField Choice list item. By default it displays: Choice 1, Choice 2, Choice 3, Choice 4, I would like it to display like the following. Choice 1, Choice 2, Choice 3, Choice ...
Andrew's user avatar
  • 441
2 votes
2 answers
462 views

Script Not Working for User With Read Permissions

I have a workflow that sends emails out. When a user receives the email, there is a hyperlink called Review. When user clicks on Review, the value of the column called ReviewStatus on the Improvement ...
Nina G's user avatar
  • 935
2 votes
0 answers
188 views

AddBehavior & navigateFrame (Open With Explorer) SP2010

I have been facing an issue with "Open With Explorer" and well, restarting WebClient service helps sometimes, restarting my PC also helps sometimes, but that is totally not handy. I have taken a very ...
Murilo Santana's user avatar
2 votes
1 answer
385 views

Color Row if Date in column = Sysdate in SharePoint Foundation 2013 using CSR

I´m using a List with about 400 Rows, for each day one. Now i want to color each row where the Date is a Day of Weekend (Sat & Sun). This Part is wokring fine with this JS var statusColors = { '...
Pa Trick's user avatar
2 votes
1 answer
240 views

Insert JavaScript automatically to new pages added to SharePoint wiki library

I wanted to Insert JavaScript automatically to new pages added to SharePoint wiki library. Instead of users manually adding the script to each page, it should be present by default or added ...
spdev's user avatar
  • 21
2 votes
0 answers
851 views

Managed Metadata Global Navigation

I’m using managed metadata to create global navigation on a SharePoint Master Page. I understand that a managed metadata term set can only be applied to a single site collection. To bypass this I’m ...
user3462522's user avatar
2 votes
3 answers
4k views

Delete all items in Recycle Bin using javascript

Is there a way to batch delete all items in the recycle bin on the client side in SharePoint Online? I've tried using javascript:emptyItems() in the browser but this appears to time out after ...
Nate's user avatar
  • 744
2 votes
0 answers
901 views

Correct usage of getListItemChangesSinceToken() in JavaScript

I'm working on a Sharepoint hosted App, that accesses List Data from the Hostweb as I outlined here: EventListener for List changes in Sharepoint Hosted app I want to use the ...
benge's user avatar
  • 43
2 votes
0 answers
66 views

Collection has not been initialized(async)

I am trying to create with search(display templates). To return a list with only the followers. The following error is throwing when running: "Error: The collection has not been initialized. It ...
Julien Kulker's user avatar
2 votes
1 answer
163 views

Javascript object model says load succeeded, but object is empty?

I've got a pretty weird issue going on on a clients SharePoint 2013 environment. We're using some JSOM javascript code to retrieve details from a web. Here is a snippet of the code: function ...
Jasper's user avatar
  • 1,264
2 votes
0 answers
279 views

Starting List Item Workflow using Javascript on custom edit page

I have a custom edit page with some Javascript inserted using a CEWP. From this page I am calling a function to start a list item workflow on the current item being edited. I am using the following ...
Fairfield's user avatar
  • 612
2 votes
2 answers
66 views

Trouble updating rows of data in an External Content Type using Javascript

I've tried a few different ways of doing this, including querying the External Content Type and then updating the current item. However as far as I ever get is an undefined variable error. This is my ...
Strutt Livingstone's user avatar
2 votes
1 answer
100 views

Sharepoint 2013 - show edit to admin only

I hope this has not been asked before (I did a few search's on here first). I need to be able to only show the Blue & Grey SharePoint Bars to admins - for all other users I want to be able to ...
uatonly's user avatar
  • 363
2 votes
0 answers
240 views

how to add a link to a document using rest api

Please help me in adding a "Link to a document" using rest api to document library
user48508's user avatar
2 votes
0 answers
541 views

Sort ListView via Postback in JSLink file

I found out, that you can filter a list view in a JSLink File very easy by a postback: function filterList(ctx, filterField, filterValue){ __doPostBack(controlId, 'NotUTF8;__filter={' + ...
Dave's user avatar
  • 617
2 votes
1 answer
40 views

Top visited entries on site collection blogs

I want to develop a web part which shows the ranking of entries of a site collection. By now, I think a way to do this is to use a Javascript code added on the master page which adds a row to the ...
Daniel 976034's user avatar
2 votes
1 answer
333 views

Display image(preloaders) before content is loaded WebPart - SharePoint 2013

I'm using a plug-in called lightSlider and I notice it doesn't display the whole content on first load until I refresh. I have tried using 1. windows.load, 2. ExecuteOrDelayUntilScriptLoaded, 3. ...
naijacoder's user avatar
  • 4,232
2 votes
2 answers
2k views

Prerender executing twice

I have some prerender code that is being used to get information from another list to add into the display of the main list. I am puzzled - the prerender code executes twice. (function () { var ...
southskies's user avatar
2 votes
0 answers
74 views

CSR - One function for every field in a View?

We all know how to define one template function for one field. SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ Templates: { Fields: { "[fieldname]": { ...
Danny '365CSI' Engelman's user avatar
2 votes
0 answers
40 views

What are the different ways to consume SharePoint REST using Javascript

I know of two ways, using ajax and using SP.RequestExecutor.js. Are there any other ways. Code snippet and information around performance will be appreciated.
Swayam Siddha's user avatar
2 votes
0 answers
64 views

SharePoint look up value A (list number value) and hide Add New button if 2nd list count value B (list count) is equal or greater to value A

I have an InfoPath form displaying formation for a commuter sign up list called "Register Commute" I modified the Content Type Display Form and added a list called "Commuter Sign Up" which is ...
Kenneth Kerr's user avatar
2 votes
0 answers
223 views

How to create custom user profile properties using javascript?

Is there any way to create an user profile property using the sharepoint online javascript api? if not which is the correct way to provision custom user profile properties for an app Thanks
Jaime's user avatar
  • 401
2 votes
0 answers
1k views

Load javascript file on wopiframe.aspx in SharePoint Online

Is there a different way to load external javascript files on the WopiFrame.aspx / Word Online / Excel Online page? We are using SharePoint Online. I have some external javascript files load with our ...
ChrisbChicken's user avatar

1 2
3
4 5
30