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

Check list item title in SharePoint 2010 using ECMA script

I have a requirement that I need to check the list item title in SharePoint 2010 using ECMA script. For that I am using: this.oList = web.get_lists().getByTitle('UserThemes'); ...
1
vote
1answer
890 views

Problem adding javascript/jquery to my WebPart

My ascx looks like this: <SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="/_layouts/1033/MyProject/js/test.js"/> test: <input id="example" /> test.js looks like this: ...
1
vote
3answers
4k views

How do I run some JavaScript in a web part?

I found some JavaScript code on the web that I want to add to my custom web part so that I can modify a PageViewerWebPart's height to 100%. I just need to know what steps to take to call it. I added ...
1
vote
2answers
296 views

tag cloud: load javascript after GetAllTagTerms

On my master page i have a tag cloud web part. I use jquery to redirect tags to search center. I reference it in my master page: <script type="text/javascript" ...
1
vote
3answers
2k views

Customizing the NewForm.aspx of the SharePoint 2007 List?

I have a sharepoint 2007 list and it has 6 site columns, want to have two modes of newform.aspx page. When user clicks on Newitem, it should display only 3 site columns and there should a link to the ...
1
vote
1answer
443 views

JavaScript removed in SharePoint Publishing Page during edit

I was working on a migration of an existing site to SharePoint and when pasting the source code of the pages to the SharePoint RichText fields in the edit mode of the page, I tried to copy the HTML ...
1
vote
2answers
35 views

Color code due date field

I have modified the following script to display my ReminderDate field in red if the date is past and also the feedback field is false. Before implementing this and because I am a novice in ...
1
vote
2answers
32 views

JS Error in sp.runtime.debug.js

sp.runtime.debug.js?rev=VFkBZgkYpbAZS6abSrBqIg%3D%3D:2814 Uncaught Sys.ArgumentNullException: Sys.ArgumentNullException: Value cannot be null. This is in: sp.runtime.debug.js ...
1
vote
2answers
28 views

Add a Comment to Field items on a List

Basically I am attempting to replicate Excel's ability to add a comment to an item on a list. (The little popup boxes that can be added to Excel cells that come up with a mouse hover or click) I would ...
1
vote
2answers
80 views

Is there any init function in sharepoint hosted app, It should run once when app is installing

I have to create list when SharePoint hosted app is installing. Is there any function call in SharePoint which runs when app is adding or installing in SharePoint site.
1
vote
1answer
78 views

How to retrieve all folders in a document library using java script or spservices

I have created one document library,in that library i created some folders. How can i retrieve all folders in a particular doc lib using java script.Any ideas?
1
vote
2answers
54 views

use CSOM for the GetListAndView WebService for multiple lists/views

I know how to use lists.asmx?op=GetListAndView to get list and view details. I'm trying to do the same using CSOM. And, to keep it efficient, I wanted to make one call for multiple lists/views. But ...
1
vote
2answers
429 views

Can I run javascript based d3js.org on Sharepoint?

I'd like to try using D3.js and have access to microsoft hosted SharePoint sites. Is this possible? Where do I start on the Sharepoint side? Specifically, where can I put the .js files and the ...
1
vote
2answers
66 views

Disable Term Store Input Fields

I would like to disable input fields for managed metadata from the term store in a new item or edit item form on a custom list. How could I do this with javascript and jquery? Should work in Chrome ...
1
vote
1answer
30 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
30 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
572 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
300 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
175 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
270 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
92 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
209 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
87 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
49 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
45 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
68 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
327 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
396 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
216 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
198 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
208 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
71 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
298 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
371 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
211 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
326 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
356 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
891 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
370 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
110 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
46 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
898 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
65 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
429 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
137 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
3k 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
125 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
130 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 ...