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.

Filter by
Sorted by
Tagged with
2
votes
2answers
170 views

SharePoint Randomly Adding Code nbsp

So just now, I had a bug in my site that caused my custom navigation bar's buttons to be sized and spaced incorrectly. I had no idea where this bug came from, and had to search around for awhile to ...
2
votes
2answers
6k views

How to remove user from Sharepoint Group using JavaScript?

I want to add and remove user to/from Office 365 Group. I tried using C# code but got error : "User does not exist or is not unique". After searching on the web I can't find solution.So i tried ...
2
votes
1answer
2k views

SharePoint 2013 Custom Action Menu Item Logo?

I am wrapping up the development of a custom action on a menu item within SharePoint and have a requirement to add a logo to it. I have done some reading on this and it doesn't appear to be as ...
2
votes
1answer
571 views

Sharepoint 2010 alternative to SetCtrlFromOpt

I have been tasked with debugging custom javascript which was originally written for 2007 by a 3rd party vendor. The 2007 site has upgraded to 2010 and the javascript has stopped working. The one ...
2
votes
5answers
32k views

How do I get the value of a SharePoint:FormField with javascript?

I have a form field: <SharePoint:FormField runat="server" id="ff2{$Pos}" ControlMode="New" FieldName="Number_x0020_1" __designer:bind="{ddwrt:DataBind('i',concat('ff2',$Pos),'Value','ValueChanged'...
2
votes
3answers
10k views

Adding an item to a list using javascript — oListItem is undefined.

I'm using the code from this MSDN guide: http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx Here's what it looks like: var clientContext = new SP.ClientContext("http://...
2
votes
1answer
966 views

How To Create a Picture Library in SharePoint Online(office 365) Using CSOM-JavaScript?

Currently I have created SharePoint Hosted App (Picture Slider) using Napa Office 365 Development tool. So far, I have created picture Library Manually, and now trying to create Picture Library using ...
2
votes
1answer
4k views

jslink/client-side rendering of New and Edit forms

I'm using jslink and client-side rendering to control the appearance of some of my new, edit and display forms. I've followed many of the excellent tutorials on that site and several others. I'm able ...
2
votes
3answers
1k views

Changing A Lists row color based on a number

So I have a calculated field in my List view that gives the number of days from the contract end date - current date. I wrote the following script to change the color of the row if less then 90 or ...
2
votes
3answers
2k views

Open a modal from a link in wiki-site: Sharepoint removes javascript

so I tried to add a little horizontal menu to a wiki-site and wanted one of the links to open in a modal Dialog (a contact form). Every time I try to add it about the UI, sharepoint removes the link. ...
2
votes
0answers
2k views

Why/when to use async:false in SPservices [closed]

In recent questions related to SPServices SPServices and GetListItemChanges rendering, spservices and view title header counts Display an Announcement List inside <div> tag I see people use ...
2
votes
3answers
7k views

jquery and javascript : can i get the last ID from document library?

Is there a way to get the last ID from a Document Library with javascript/jquery?
2
votes
0answers
754 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 ...
2
votes
2answers
3k views

SharePoint Search JS returns only 500 search results

I have retrieve SharePoint search results using javascript on SharePoint Online. But it returns maximum 500 search results for any query. I have set RowLimit to 10000: var keywordQuery = new ...
2
votes
3answers
15k views

count items in a list javascript CSOM [duplicate]

I am wanting to count the number of items in my list. Using CSOM in javascript I have tried it but my code doesn't work. Where am I going wrong. Here is my code: var clientContext = new SP....
1
vote
1answer
5k views

Saving Page with WebPart error Invalid postback or callback argument

I'm using SharePoint 2010 Foundation with Visual Studio 2010 Ultimate. I developed a Web Part with extensive use of JavaScript and Ajax call. I deploy application by Visual Studio correctly, enable ...
1
vote
2answers
659 views

Office 365- Accessing lists refers wrong URL (URL/App name)

I'm new to NAPA tool. I started to build simple apps using NAPA tool. And I tried to access a list in office 365 site using below code. After I publish the app it shows an error message: Message: List ...
1
vote
2answers
12k views

How to get List Name from JS Object Model - List Name from URL problem

I'm trying to connect Ribbon to Pages.. This works, javascript get what I need and pass as parameter to my page.. I pass the URL and the SelectedItemsID.. I'm facing a problem: If I had a List ...
1
vote
1answer
1k views

JavaScript OM to Approve Designer Workflow Task

I have a SharePoint Designer 2010 approval workflow and I am attempting to approve the tasks via JavaScript Client Object Model. I am able to change all of the fields to "Completed"/"Approved" but the ...
1
vote
3answers
12k views

Get id of current inserted item by javascript

I'm currently trying to get the id of my currently iserted item. I'm making a timesheet which user is able to save and retrieve his own timesheet. The thing is that i put the ID of an item in the html ...
1
vote
2answers
7k views

How to Get User Active Directory Groups in Sharepoint Online

I can't find any documentation or a way to find if a user belongs to an AD group with Javascript neither with the REST API or with the client model JSOM. I have a page in a Sharepoint site and I want ...
1
vote
2answers
602 views

Can't get jquery to work

I can get this block of jquery to work on basic HTML in Codepen However, it doesn't seem to be working when I try this on a SharePoint 2013 Publishing site. I embedded the CSS and JQ in my master ...
1
vote
2answers
6k views

Expand collapse text on a Wiki page

I am trying to have a section of text on a Wiki page hidden by default, but when clicking on a link/header the text is then unhidden/expanded. I have searched online and thought I was getting ...
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'); context.load(...
1
vote
1answer
3k views

SharePoint 2013. JSLink (CSR) for field Type=“User” on EditForm

How to create custorm render for field type="User" on EditForm? I need to replace standart peoplePicker control with my custom render. Code below work without exeptions, but don't set 'Sponsor' field....
1
vote
2answers
4k views

how to insert users into particular group using csom javascript

I have created one group using csom javascript upto here working fine . I want to how to add users to particular group using csom javascript.Any ideas?
1
vote
4answers
2k 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, itemID,...
1
vote
1answer
1k 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 = clientContext.get_web().get_lists().getByTitle('...
1
vote
0answers
402 views

Load full list XML into JavaScript variable via CEWP

Currently I am using the lists.asmx webservice to POST a soap envelope and return specific list items. I really want the whole contents of the list. I realize how large that might get, but if this ...
1
vote
1answer
983 views

Change the Cell color on postrender using JSlink

I am using JSlink to change the cell color of a calculated column. I have to use Postrendering for that. The problem is that I cannot manipulate the cells. I can color the rows but cannot color just ...
1
vote
2answers
649 views

How to write a caml query that filters by .pdf or folders?

How can I write a CAML query (for javascript ecma) that filters by only pdf documents or folders in sharepoint 2010? (this is for document libraries) Thanks.
1
vote
3answers
28k views

Use CAML query based on ID to retrieve a file name?

With jquery and spservices, I use getSelectedItems to retrieve the IDs of a few documents. Can I have a loop which goes through a caml query for each of those IDs to retrieve the file name (...
1
vote
2answers
4k views

Populate User Properties in list form using JavaScript in Sharepoint 2013

I have a list where Administrator adds users and it contains information of the users(Employee Name, First Name, Last Name, Email etc). Employee Name is a people picker control and I need to populate ...
1
vote
2answers
2k views

How to change the SharePoint 2013 logo image dynamically?

Is there any way to change the SharePoint 2013 logo dynamically, ideally via javascript? I have tried: document.getElementById("onetidHeadbnnr0").src="\path\image.png"; Also tried: div = ...
1
vote
2answers
1k views

How do you use JS Link with Pages?

I'm trying to make a JS Link script that will work with my site's Pages list. Basically I want to display a simple list of page titles. I'm using the Pages Web Part (Web Part > Apps > Pages). var ...
1
vote
1answer
3k views

Java script: how to get Workflow Id from Workflow Task Form

I need to get the Workflow Id with java script after editing a Workflow Task. What I have this far is only a script that gets the Task Id when the EditForm is opened: $(document).ready(function () { ...
1
vote
2answers
2k views

CRUD Tasks using Javascript via REST OData

I've looked this post to build CRUD process using JavaScript via REST OData. I've have managed it for Risks and Issues list. But, I haven't succeeded for Tasks item. What's the difference between ...
1
vote
2answers
1k views

Inject dynamic javascript using MasterPage

We have to inject dynamic javascript (contains a encrypted var value) into all web pages. What is the best way to inject Dynamic Javascript using Master Page? Other Details: SharePoint 2010 STD ...
1
vote
2answers
696 views

How to add an default Image to SharePoint list item?

I have a column named photo How can I add a default image in a list item, which in my case is photo? for example If a user does not have the proper image for an item, or if he forget to add image. ...
1
vote
2answers
117 views

Register Javascript For Document Library

I need to run a JavaScript script when a document library is opened/shown. The script should be available only on the specific document library. One possible solution could be adding the script ...
1
vote
1answer
10k views

Using CORS with SharePoint REST services from SPA

Continuing from my earlier question SharePoint Webpart development using SPA or JavaScript library for better performance I ma exploring Durandal with JayData and also KO and SPServices. The ...
1
vote
1answer
126 views

CountInstancesWithStatus returning empty response

I'm trying to get a count of all instances of a workflow by status. Below is the code I'm using. I have not been able to find a lot of information about WorkflowInstanceService....
1
vote
2answers
6k views

How can I retrieve list items from a subfolder using spservices?

I have a document library with subfolders containing images. I'd like to traverse the subfolders and grab the URLs of those images so that I can display them on my little js web app I'm whipping up. ...
0
votes
0answers
295 views

Javascript Conflict on Visual Webpart when adding multiple times with different webpart properties on single page

What I am doing: I am retrieving list items from list using javascript as per visual webpart custom property. I have created a dropdown in webpart editor part from where I am getting site url. As per ...
0
votes
1answer
2k views

Refreshing a Web Part Without a Post back in SharePoint 2013

I have a list with many columns in SharePoint 2013, I used SharePoint designer 2013 for displaying items , I have tow web parts in a page that I created in SharePoint designer 2013, one web part ...
0
votes
2answers
2k views

Change file name

I am updating a file in document library using a Put request from the client side. I need to know, how to change the file name after the file has been updated. My upload code is working fine. I can ...
0
votes
2answers
673 views

Stuck on using vuejs to create a table in SharePoint 2013

I am new to vue and I want to use in SharePoint to render a table from my list data. I've got the code working to the point of getting data from rest api using jquery ajax. I am stuck on how to ...
0
votes
1answer
2k views

Invalid field or parameter requestInfo.url. in SharePoint hosted app

I am working on SharePoint hosted app. I am facing an error in the beginning of the app i.e. "Invalid field or parameter requestInfo.url." This error is came from bellow code: function execOperation(...
0
votes
2answers
16k views

Open Document Library documents in a new tab

The Problem: I am trying to find a way to open up SharePoint Document Library documents in a new tab. This seems like it should be a setting option in SharePoint; however, if it is, I'm unable to ...
0
votes
4answers
714 views

Getting Current User - On Page Load (JavaScript)

Basically, what I want to achieve is to hide particular elements in all SharePoint sites within a single farm. What I did is I created a SiteCode.js file inside the Site Assets folder and filled it ...