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.

learn more… | top users | synonyms (2)

1
vote
1answer
28 views

Add user to group error - Code

I am getting an error when trying to add a user to group in JavaScript, here is my code below: user = web.ensureUser("domain\\natalie"); membersGroup = web.get_siteGroups().getByName("site ...
1
vote
1answer
29 views

Get a specific item from the return

I have some javascript which is looking to a list, it returns more than one result. I want to be able to store each result in its own object. How can I do this? Please see my code for illustration ...
1
vote
1answer
444 views

Uncaught ReferenceError: SP is not defined

I am trying to implement to Sharepoint simple function from MSDN which I've placed in aspx file but I got this error in js web browser console: Uncaught ReferenceError: SP is not defined. Any ideas ...
1
vote
1answer
224 views

How to use JSOM/CSOM in SharePoint 2010 to get information about the current user like department, title, manager and phone number

I've seen how to get information about the current user using CSOM/JSOM from Get current user in Client Object Model with javascript? but I can't figure out how to get other properties like: ...
1
vote
4answers
147 views

403 Error on REST/JSOM call within a form in SharePoint 2013

I try to update a ListItem in a (foreign) SiteCollection wihtin an edit form by CSOM. But I can't get it to work without getting a 403 error: cs.updateListItem = function(siteURL, listNameSTR, ...
1
vote
3answers
204 views

JSOM 2013 Get Item from List containing all fields

I'm trying to get a specific list item (by id) using JSOM and want to get all fields in this item. Though, for some of my fields I get the error that I need to request the field (which would be done @ ...
1
vote
1answer
81 views

Personalizing Add In Parts with javascript in Sharepoint 2013

We have a customer that wishes to make it easier for the user to customize their webpart pages. We are therefor using javascript to build a simple grid where users can add, remove and move Add In ...
1
vote
1answer
180 views

Retrieving current user's profile picture throws “Access Denied” error

I'm trying to get the current user's profile picture and I'm using CSOM. But I receive an Access Denied error, when I actually gave Read permission to user profile service. ...
1
vote
1answer
83 views

sharepoint profile picture

Is there any possibility to change profile picture or uploading a new profile picture in SharePoint Online by using SharePoint hosted app, via JavaScript or jQuery? How do you solve it?
1
vote
1answer
45 views

jQuery Blur function in Content Editor web part in SharePoint 2010 List form

Want to know how to use a jQuery blur function for my SPNumberField, single line of text etc fields.I do not have the ID of the field, also how to get the ID for using the same in jQuery function? ...
1
vote
1answer
42 views

Why does ElementById return null for a Sharepoint app?

I'm trying to get the an element's ID tag using JavaScript in order to manipulate the styles. The element is created by an app from the Office Store but I would like to change the look. <div ...
1
vote
2answers
60 views

Insert current logged on user's email address into script embeded on Sharepoint page

I have to login to another system from SharePoint. This is done by embeding a piece of javascript which redirects the user to the site, but must grab the current users email address to insert into the ...
1
vote
1answer
297 views

Javascript running before SPServices call is complete

Note: I am a beginner and new to SharePoint and not a regular with SharePoint based projects. Kindly refer commented out code only if needed. I am building a sample page and displaying it on ...
1
vote
2answers
303 views

Get Listitem Attachment URL

I want to get the Attachment URL with via REST or Javascript. Is there an easy way? The reason I need this, is because I want to build a marketplace in my company. User creates new list item User ...
1
vote
1answer
160 views

Using csom search api, how can I search lists based on content types?

I have multiple subsites and each subsite has a list called "Articles". Each has two content types. "News Articles" and "Success Stories". I would like to search based on the content types above using ...
1
vote
1answer
169 views

Copying all the field's value of a list to other list using javascript

This JavaScript code copies title field of one list to other list. <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js"); var siteUrl = 'url'; ...
1
vote
2answers
194 views

Get ID after inserting Item into SharePoint 2013 Host Web List

I am currently creating a SharePoint 2013 hosted app on Office 365 and I currently have some JavaScript that inserts item into a host web list. I wondering if it is possible to get the ID of the item ...
1
vote
1answer
27 views

Best Practices for small changes from Quality to Production

I am at a new job, and how they manage development and then deployment to production is strange. So, I was curious what is the best practice for this scenario? A user just wanted a form field to have ...
1
vote
1answer
67 views

Problem JSLink (color priorities) - Nothing changes

I have a problem using JSLink. The goal is to color in red, orange, green the priority field. For information, I followed step-by-step the tutorial given by Microsoft. In Site Features, I've ...
1
vote
2answers
834 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 ...
1
vote
2answers
271 views

Custom Jquery script to hide fields inside my New & Edit form is not working on Iphone safari web browser

I have defined the following jQuery script to hide some columns inside my Edit & New built-in forms:- $( document ).ready(function() { $('.ms-formtable nobr:contains("Item ...
1
vote
1answer
340 views

Get Display Name from Account Name

I have used SPServices to get a user profile by their name, and in the process, I wish to display their supervisor's name as well. I can pull this name from the user's object, but the supervisor is ...
1
vote
1answer
186 views

Check if user is member of group

I have a SharePoint group name "Admin". Can someone provide me JavaScript code to check if the current logged in user belongs to this group? I have a query which I want to run based on this ...
1
vote
1answer
67 views

Make load variable private

I have the following function which retrieves the current user's properties: function helper_redirect(){ this.clientContext = new SP.ClientContext.get_current(); this.oWeb = ...
1
vote
1answer
311 views

Get AD user object GUID using Client Object Model in Sharepoint

I want to extract the objectguid corresponding to a username from the AD using javascript in Sharepoint. Is it possible? I can get some properties like the current username by using ...
1
vote
1answer
337 views

How can I update a Site Column with the content of an array with javascript CSOM?

I'm relative new to Sharepoint 2013, I'm trying to update the content of a Site column with the content of an array, I can retrieve and visualize the content of my site column, the user is able to ...
1
vote
2answers
789 views

Sharepoint Read list items using Javascript

I wrote a query to Read list items and a specific column value like this var invoiceitemID = SPUtility.GetSPField('ID').GetValue(); var clientContext = new SP.ClientContext.get_current(); var oList = ...
1
vote
2answers
349 views

Is it possible to call JS file in Event Receiver?

Is it possible to call JavaScript file in any of the events in event receiver in SharePoint 2013.
1
vote
2answers
108 views

Print only the used fields in Sharepoint using JavaScript

I need to print only the column that has been created by me. function retrieveFieldsOfListView(listTitle,viewName){ var context = new SP.ClientContext.get_current(); var web = ...
1
vote
2answers
45 views

Moving wepart down while scrolling

We have a wepart page with 2 sections. On the left side is a big task list and on the right side is a short list with informations to complete the task. Both lists are list view webparts. Is it ...
1
vote
1answer
828 views

SP.SOD.loadMultiple Issue

I am trying to load the project context in order to access some data. I am using the SP.SOD.loadMultiple function as follows: SP.SOD.loadMultiple(['sp.core.js', 'sp.runtime.js', 'sp.js', 'ps.js'], ...
1
vote
2answers
63 views

how to email data from edit from of sharepoint calender list

I have a sharepoint list with 3 columns. User edits the item and updates a column. CLicks on custom button present on the ribbon for send email. The email body should contain the value of 3 columns ...
1
vote
1answer
409 views

SP2013: JavaScript Object Model - Setting the value of a list field

How do I set the value of a field in a list using the JavaScript object model? I am trying to click a button on an existing page that automatically creates a new wikipage (which I have done) and ...
1
vote
1answer
132 views

ASCX controls, how to prevent multiple inclusions of same Javascript file?

By example we have two webparts on page, with ascx controls. One ASCX control loads this.Controls.Add(new ScriptLink() { Name = ...
1
vote
2answers
2k 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 ...
1
vote
1answer
120 views

Creating List based on List template with content

Now I could successfult create list based on list template but when i saved my list template i could say "Include Content" but when the list created by this code it was empty with no content any ...
1
vote
1answer
126 views

Autocopy TypeScript and LESS

I am developing a SharePoint 2013 App with Visual Studio 2013. My problem is, I use TypeScript instead of JavaScript and LESS instead of CSS. When I change the *.ts and *.less files they are not ...
1
vote
1answer
198 views

Seconds since item created with REST. Perhaps use server current time (clock)

I'm trying to find the most correct way to determine the amount of seconds since an item was created. My first approach is to simply diff the Created property with the browser time, e.g., ...
1
vote
2answers
543 views

Sharepoint Date compare using Jquery

can anyone let me know whats wrong with following code var day = new Date(); var Today = day.getFullYear() + '-' + (day.getMonth() + 1) + '-' + day.getDate() + ' 00:00:00'; ...
1
vote
1answer
896 views

Getting and updating the value of a hyperlink/picture field in Sharepoint 2010 using Javascript and COM

I'm trying to get the image url for a Hyperlink or Picture column field in a SharePoint list, however after trying a lot of variations I just can't get the url to display in the alert to make sure i'm ...
1
vote
1answer
278 views

Automatic Bootstrap Tabs in SharePoint

I'm trying to implement this solution to a SharePoint public facing site. The timer seems to be working as I'm getting errors in browser consoles at every interval but nothing is happening: ...
1
vote
2answers
123 views

How to trim down date to example 2014-10-10?

How can i trim down date from this Fri Oct 31 2014 01:00:00 GMT+0100 (Västeuropa, normaltid) to this 2014-10-31 on my get_fieldValues i think i can use .setDate.getDate()+ 1).toISOString().substr(0, ...
1
vote
1answer
937 views

Run js after display template has loaded/rendered content

I have a javascript file that I want to run after my display template has rendered. I have added it to my display template like so : <script> $includeLanguageScript(this.url, ...
1
vote
1answer
380 views

Some javascript not working in web part

I'm noticing that not all of my Javacript - all of which worked in a basic ASP.NET Web Forms application - is working. I'm not sure what could be causing this. For example, the following JS/C# calling ...
1
vote
1answer
1k views

Updating document metadata using Javascript or jQuery

I have a large, complicated script that copies selected documents from Library A to Library B when a user clicks a button. At the end of the script (as a final step), I'm calling the three functions ...
1
vote
1answer
2k views

Get user Login from User or Group field

I have a list with User og Group field. I've retrieved item from it, now I need to get user's Login. By reading User or Group field I can get only user id and account name. here's my code: var ...
1
vote
2answers
18k views

Create json data dynamically from list using javascript

Can anyone tell me how to generate json data from SharePoint lists in the below format using java script. var jsonArray = [ { "user": { "id": 100, "screen_name": "d_linq" } }, { "user": { ...
1
vote
3answers
10k views

Get list ID and selected item ID

I use SharePoint Online and working in Visual Studio with SharePoint hosted app I need to get list id and the id of the SELECTED item in the list And i use a ribbon button to show a dialog and want ...
1
vote
1answer
1k views

TaxonomyField.GetWssIdsOfTerm in JSOM (SharePoint 2013)

For building a CAML query including filters by Managed Metadata Column, I need to get the wssid for terms I've only the unique ID. I found a lot of examples using C# and ...
1
vote
1answer
798 views

Anonymous Acess in Client Model (Javascript in Office 365 in Master Page)

I have the following code function retrieveListItems() { var clientContext = new SP.ClientContext.get_current(); var oList = ...