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)

0
votes
0answers
28 views

REST Async responseText different to Sync

When I send a request to http://Sharepoint/_vti_bin/ListData.svc/ListName using a Synchronous request as below the response comes back as a feed with "m:properties" present and easy to extract. This ...
2
votes
1answer
117 views

How to make a print button in infopath form?

In infoPath form I have a button which duty is to print the current document, I have been trying this one thisXdocument.PrintOut(); but the following error occurs "The name "thisXdocument" does not ...
1
vote
1answer
146 views

How to encode a list name for REST in sharepoint 2013 [duplicate]

I created a list in the en site called hello's~`!@#$%^&*(){}[]:;"'<>?/\|*-+. What I am trying to do is figure out what exactly is the encoded version of the name if I am trying to target ...
0
votes
0answers
31 views

What should I do to not disappear the list which I create by this code?

function createList() { listCreation = new SP.ListCreationInformation(); (listCreation.set_title("Countries")) //list title listCreation.set_templateType(SP.ListTemplateType.genericList)...
0
votes
1answer
32 views

Apply a filter from a Date Filter web part that was set with JS/JQuery

I have a Date Filter web part that is connected to a list. I can set the content of the filter with jQuery, but how can I get the filter to apply itself when I set the value this way? Normally you ...
0
votes
0answers
31 views

SP2013 on-prem how to check if search service is working?

We have an onsite 2013. Our team doesn't have access to central admin. We are using cross-site publishing and a lot of display templates -- as well as some ajax and spservices to query the search ...
0
votes
0answers
32 views

How to getSelectedItems of a list when user has Read permissions

I have a List where users select items from the List. I want to know which items were selected using JS. Here's a snippet: var selectedItems; var listId; var context = SP.ClientContext.get_current(...
0
votes
1answer
102 views

Best way to encode list names in sharepoint 2013 rest url's?

In SharePoint 2013 rest url's, some of them includes a list name which is passed by a user (in the web part settings) which I then use in a web part. I then stick the list name in a rest url, but now ...
0
votes
3answers
511 views

Issues with Minimal Download Strategy and _spBodyOnLoadFunctionNames.push

I noticed that on the sites that have MDS activated, functions that I queue up with _spBodyOnLoadFunctionNames.push do not get executed. I can step through my code and I see ...
1
vote
2answers
374 views

Error on toISOSTring() object doesn't support property or method 'toISOString'

I have tried almost everything I found on this forum but issue is not resolved. Code is working fine on Chrome but not in IE 11 (windows 7) which is used by everyone in company who will use my ...
1
vote
1answer
34 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 ...
0
votes
0answers
26 views

Script to link image and YouTube video

I know how to link a YouTube video to a graphic image to play the video on a separate page, but how can I get the video to play on the same web part/page when clicked on the image in 2007?
3
votes
3answers
523 views

Query multiple lists using javascript/CSOM

I'm about to query multiple lists using JavaScript (JSOM, SharePoint 2010). It's working when querying one list in a time, but that's annoying when I'm having lots of lists. Working example: ...
0
votes
1answer
72 views

Download attachments as .zip file

I need to develop a C# custom webpart which allow users to download attachments from a sharepoint list. My webpart lists the attachments which the user has selected. Then, it must show him a link to ...
0
votes
1answer
308 views

Prepopulate managed metadata field in NewForm

I am trying to prepopulate a managed metadata field in a NewForm of my list. I don't want to save the value as it will be used as a suggestion passed in through URL a parameter that the end user is ...
4
votes
1answer
116 views

Differing ways to make executeQueryAsync calls (Function.createDelegate)

I want some understanding on two programming patterns I've seen and when to employ them. The question is about callbacks and delegate. In the first code there are two distinct functions, success ...
4
votes
2answers
223 views

Create SharePoint List programmatically

I want to create a SharePoint list programmatically from a SP addin. I would like to know which approach is better: Using JavaScript or Using REST Thanks In Advance
1
vote
1answer
35 views

Problem with adding new item to the list depending on the structure

I've following issue. Function which supopse to create new item on the list, adds the row only when the list is situated in the root node (webUrl = "http://rootserver.com/";) whereas when it is placed ...
1
vote
1answer
200 views

Uncaught TypeError: Cannot read property 'Selection' of undefined

I have a button that runs a JS function (in a Script Editor Web Part): function flexRegistration() { var context = SP.ClientContext.get_current(); var listId = SP.ListOperation.Selection....
0
votes
1answer
574 views

Get user profile picture URL using ID CSOM

I am trying to get the user profile picture url for a user using some JavaScript, I am querying a person and group field in a list and getting the use id via some CAML Query. However the issue I am ...
3
votes
4answers
187 views

Get item count of a list without getting all properties

I want to get the item count of a list, so my code looks like this: var list = context.get_web().get_lists().getByTitle("tasks"); context.load(list); Doesn't this way retrieve all properties for ...
4
votes
1answer
272 views

How to show and hide a paragraph in html when a button is clicked?

I have the following query. I have a <pre> tag and it has some text inside but i want to hide <pre> when a button is clicked. Following images shows code: When this addNewTest() ...
3
votes
1answer
100 views

Uncaught Error: Incorrect usage of exception handling scope

I am trying to implement try/catch scope in my JSOM, but I am getting the error message in the question's title. Below is my code: errScope = new SP.ExceptionHandlingScope(context); ...
6
votes
2answers
130 views

SharePoint Online - direct from one page to another

I want to be able to go from one page to another in sharepoint, and get the value of the previous page that the user came from. I investigated the method called: SP.Utilities.HttpUtility.navigateTo, ...
4
votes
1answer
129 views

Get ctx.ListData inside Calendars

I want to retrieve some data about each item in a Calendar, but I can't find ctx.ListData inside Calendar view. Is this a bug in SharePoint?
1
vote
2answers
75 views

How to focus field when opening modal dialog

If I have a modal dialog which looks like the following, how can I focus the textarea after opening the dialog? By simply adding $('#txtArea').focus(); after the code, the txtArea has focus for only ...
3
votes
1answer
465 views

How to disable fields in list newform.aspx/editform.aspx using javascript/Jquery

Need to disable Managed metadata field (the below code disables the textbox of the field but not the button which is used to select the value to the field), Choice field with radio buttons or ...
0
votes
1answer
112 views

Sharepoint doesn't always execute script

So i have a webpart where some very smart people have hardcoded the number of items to show... So i've insert some javascript in a script editor to show more items (since those smart people just add "...
0
votes
0answers
36 views

Set a value for all field in desired column? javascript

i have the following solution: in my SP list called QUIZ i have a column named koha i also have a userinterface that is build via XML in my javascript solution the current setting are when you ...
1
vote
1answer
55 views

IMNRC works once but not twice

I'm working a solution for a Campus Map. The basic idea is that I have a xml file in site assets, as well as a .gif. The .gif is shown in a Script Editor web part and uses a map. There is currently ...
0
votes
2answers
263 views

Passing Values to iFrame from URL

Currently I am working on a bit of a easy setup, but I am confused how to proceed any further. I have exhausted roughly 4 hours looking for the right solution. What I basically am trying to do is ...
0
votes
0answers
18 views

Set People picker from AJAX call [duplicate]

I need to set a people picker field with the value from a JSON/verbose Ajax call. Using the below format I am able to set everything from text fields to selection fields but can not seem to set people ...
0
votes
1answer
31 views

SP13: Connecting Content Types

Working in SharePoint 2013. Have a custom list with a bunch on content types. Some of the content types share the same columns. My assumption was that if a column is filled in one column type it ...
1
vote
1answer
32 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 ...
0
votes
0answers
26 views

SharePoint online - API data access quality

How much access to the data will I have if I use SharePoint online? Will I be able to do reporting from any list or rdl hosted in SP online via the available javascript api? What about pulling data ...
0
votes
1answer
74 views

Showing error of 'PreSaveItem is not defined' when trying to save item in any list on restored site

We took a backup of production site and restored it on our development server. The site has been developed on OOB or SharePoint Designer with no custom development on it. The restoration process went ...
2
votes
1answer
102 views

SharePoint 2013 Online (365): How can I insert html tags, such as divs and footers in the OOTB master page?

This is my first time working with SharePoint Online and I have been asked to create a master page with some custom links inside different divs and a footer. I saw another post here, but it did not ...
3
votes
2answers
521 views

javascript to set value of a lookup field

I have 5 values in my lookup column. I need to select one and show it there by default. document.getElementById("IdofLookupField").value="Country"; But this is not working, this doesn't set the ...
3
votes
1answer
127 views

Security Error while doing REST update on the SP list

I am trying to make update with the usage of REST but I got an error: -2130575251, Microsoft.SharePoint.SPException. The security validation for this page is invalid and might be corrupted. ...
2
votes
1answer
51 views

Async REST Queries and setting field values to global variables

I'm having a problem wrapping my head around these sharepoint async REST queries. The problem is that an async REST query isn't setting a field.value because the assignment is happening to soon. Even ...
3
votes
2answers
174 views

Object Doesn't support property or method '$1X'

I am using JSOM in Nintex Forms 2013. My script includes are /_layouts/15/sp.runtime.debug.js /_layouts/15/sp.debug.js /_layouts/1033/init.js /_layouts/MicrosoftAjax.js /_layouts/sp.core.js /_layouts/...
2
votes
1answer
65 views

How to handle & and + characters in hyperlinks in the search People hover panel template

In our SP Server 2013 environment we have an employee directory. The hover panel that shows up next to a result shows the Department name of an employee. This is a clickable hyperlink. When a user ...
0
votes
1answer
107 views

Problem with retrieving Sharepoint list with js

I am trying to retrieve list from SP page but I got following error: Uncaught TypeError: Cannot read property 'apply' of undefined from MicrosoftAjax.js file. It seems that it's due to the ...
1
vote
1answer
251 views

How can I run JavaScript after saving SharePoint list item properties from editform?

I have some code I want to run on a list item after any properties (metadata) are saved from the editform window. Where/how can I put JavaScript to run at that time? Thanks!
0
votes
2answers
42 views

Broke my SharePoint site by modifying master page, help!

I was attempting to add Javascript that would remove the "recently viewed" list of the SharePoint page. I ended up removing the code, and upon saving the page and navigating to the SharePoint site, I ...
1
vote
1answer
767 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 ...
0
votes
1answer
402 views

Compare two int columns in a Sharepoint list

I´m doing a course catalog app for SharePoint. And I have a list called Courses. In that list I have two columns called: Seats and FreeSeats. When you make a new course the boss decide how many can ...
0
votes
4answers
121 views

How to retrieve and read items from sharepoint list and assign them to a variable with JavaScript?

I have the following list how can i retrive the value of koha column for first row and second row separate, datatype for koha column is number and how to assign value of koha into a variable var ...
8
votes
1answer
263 views

HierarchyRequestError in sp.ui.rte.js

How can I resolve this error? I see this in Firebug's Javascript Console for sp.ui.rte.js on every Sharepoint Page that's loaded. It persists through an iisreset. And it is always the very last ...
3
votes
3answers
845 views

Getting Value of Radio Button on SharePoint 2013 Edit Form using jQuery

EDIT: updated verbiage to reflect this is specifically a Radio Button choice field. The below script works when the choice is set to display in a drop down. I'd like to be able to do the equivalent ...