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
8 votes
2 answers
23k views

Format Date using Javascript Object Model

I am using the javascript object model to get a date field back and display it on a page e.g. oListItem.get_item("MyTestDate") This displays on the page by default as: Thu Jul 25 09:30:07 PDT 2013 I ...
user1786107's user avatar
1 vote
2 answers
1k views

Is it possible for a html textbox to populate a sharepoint column in a list?

Here is the scenario: SharePoint 2010 doesn't have a back button, this makes it difficult when a user messes up in a branched survey. I have created a little JavaScript embedded html page that I ...
Richerdk's user avatar
0 votes
2 answers
2k views

Totalling output from column for all entries in a list

SP2010: I need to come up with a total (number) of a column for all entries in a list. For instance: Given a list with entries which can be comprised of apples, oranges, and pears, and their ...
Pᴀᴜʟsᴛᴇʀ2's user avatar
-1 votes
2 answers
154 views

:net contra Javascript [closed]

If do some client programmering, what factors should I take it into consideration if I gonnna use javascript/ECMAScript or .net in relation to retrieve some functionality from SharePoint and apply it ...
HelloWorld1's user avatar
  • 1,035
2 votes
0 answers
1k views

Install an app from the appCatalog using javascript CSOM

I'm trying to install an app in a site from the AppCatalog using the javascript CSOM I get the apps from the App Catalog using req.apps = SP.AppCatalog.getAppInstances(clientContext, oWebsite); I ...
Benja's user avatar
  • 21
5 votes
1 answer
10k views

Javascript : How to handle version conflict errors when using javascript COM?

so I use quite a bit of the javascript client object model for CRUD operations to lists from custom pages (inputs) and I have found that I get version conflict errors on saves from time to time....its ...
Justin's user avatar
  • 1,361
0 votes
1 answer
1k views

Javascript Object Model REST/AJAX: does callback/resulting function have access to the id of newly created item

so if I use rest like method to create a list item in javascript, can I get the id of the newly created item in the callback/result function? function createNewRecord(url, body, callback) { $....
Justin's user avatar
  • 1,361
11 votes
6 answers
98k views

How to get the login name of the current user using JavaScript?

I tried this code: var context = new SP.ClientContext.get_current(); this.website = context.get_web(); this.currentUser = website.get_currentUser(); alert(currentUser); But I got an ...
Nera's user avatar
  • 528
0 votes
2 answers
654 views

Javascript in my masterpage loads in Firefox but not IE

In my masterpage, I've loaded a simple javascript file from /_layouts/myfolder/myjs.js - and the script loads and runs in Firefox (even in different instances and with different plugins) but not in IE ...
bgmCoder's user avatar
  • 3,581
1 vote
3 answers
6k views

Jquery is not working on sharepoint date time control

Hi In my application page i have a sharepoint datetime control. I am using jquery on text changed event to calculate the number of days and displaying in a text box. Now i want to fire the same event ...
santosh kondapalli's user avatar
25 votes
5 answers
119k views

Get current user in Client Object Model with javascript?

var ctx = new SP.ClientContext.get_current(); var web = ctx.get_web(); ctx.load(web); var user = web.get_currentUser(); alert(user); I used above code to get the current user using JavaScript, but I ...
Nera's user avatar
  • 528
3 votes
1 answer
2k views

Getting survey list settings (questions, possible answers) via REST

I need to custom render the survey on the client side so I need to be able to get it's settings via a REST (or web service) call. I tried calling Web/Lists(listguid)/Fields and I get all the fields ...
Andrey's user avatar
  • 283
4 votes
2 answers
4k views

Is there a way to check if a workflow is completed using Javascript?

I created a form that start a workflow automatically when an item is created, and I redirect to html page that shows a message like "Processing... please wait.", and I wait 3 seconds and so redirect ...
Guilherme de Jesus Santos's user avatar
1 vote
2 answers
10k views

Attachment Upload using SPServices and Not the JS File API

I am trying to figure out how to use the SPServices JS library to upload a file without using the HTML5 JavaScript file API. This is specifically targeting IE9. I have a solution that works with all ...
Robert Kaucher's user avatar
2 votes
3 answers
5k views

How to Create Piechart in sharepoint 2010 Based on the List item Values? Only using Javascript/jquery

I have a CustomList in Sharepoint 2010 as Mentioned Below.have two columns Team and Values of Team List A Team ValuesofTeam A 9 A 6 B 7 C ...
madhan's user avatar
  • 21
0 votes
3 answers
11k views

Jquery to load dropdown on selected index change of another drop down in sharepoint 2010

I have 2 dropdowns. On Selected Index change event of ddlTaskFrequency dropdown i want to load another drop down. For example: If ddlTaskFrequency text= Daily or Weekly i have to load another ...
santosh kondapalli's user avatar
2 votes
1 answer
1k views

In Chrome, Async Postbacks Fail

In Google Chrome, inside of an Update Panel, the first async postback succeeds, but the second silently fails. The issue is discussed many places: http://www.marten-online.com/sharepoint/ajax-second-...
Markus's user avatar
  • 349
2 votes
4 answers
16k views

How to get result from SP.UI.ModalDialog.showModalDialog back to C#?

I have a code on a visual web part user control (see below): Could you please advice, how to get value from the callback function back to the C# in code behind to process it? <script type="text/...
Dmitry T's user avatar
  • 385
0 votes
1 answer
147 views

Retrieve notifications with JavaScript

I want to incorporate social feed into my SharePoint webpart. I followed this tutorial: Code example: Retrieve social feeds by using the SharePoint 2013 JavaScript object model. Even if I used ...
Tschareck's user avatar
  • 2,155
1 vote
3 answers
2k views

SP ECMA/JS get_siteUsers() not working? trying to get user with getByLoginName()

I am trying to get specific users with this line using ECMA but I keep getting error: this.oUser = cxt.get_web().get_siteUsers().getByLoginName('dev\\joe'); I keep getting property or method ...
Justin's user avatar
  • 1,361
4 votes
1 answer
390 views

What is ULS2Vv:;? [duplicate]

I see that label in most SharePoint JavaScript libraries. I am curious - what's that used for? Example: EnsureScriptFunc("clienttemplates.js", "RenderUserFieldWorker", function () { ULS2Vv:; // &...
Andrey's user avatar
  • 283
6 votes
2 answers
8k views

Create Page using REST API

I have spent two days trying to create a page with a specific Content Type in Pages list using REST API. It goes into error handler and returns "{"readyState":0,"responseText":"","status":0,"...
Medes's user avatar
  • 2,086
0 votes
0 answers
115 views

JavaScript tab control that works on SP 2010

I'm trying to use jQuery UI Tabs but it seems to conflict with SP2010 styles, do you know any alternative that Works with SP2010? Or maybe a way to fix this? The same issue occurs with Bootstrap ...
juliano.net's user avatar
10 votes
1 answer
10k views

SP JSOM: is there any way to get the group by name instead of getById(10)

is there a way I can use the below with something like getByName(thisGroup), instead of getById(10) in SP 2010 jsom: function setSomeUsers(dataObj, projGroup) { var clientContext = new SP....
Justin's user avatar
  • 1,361
2 votes
1 answer
470 views

SP2010 JSOM: error when trying to get all users of specific group using javascript

having trouble getting users return from specified group using javascript per this on MSDN var siteUrl = '/sites/MySiteCollection '; function retrieveAllUsersInGroup() { var clientContext = new ...
Justin's user avatar
  • 1,361
0 votes
1 answer
1k views

SP2010 JSOM: possible to automate breaking inheritance of item, and controlling role assignment using javascript

i am working on a custom system I am building into a site that allows various reps, of various departments to enter project information and many different aspects of related data (children) into the ...
Justin's user avatar
  • 1,361
0 votes
1 answer
197 views

ecmascript/javascript to check current status of timer job

I want to show sharepoint notification when user opens a list form using oob. I am basically doing some sync with external list and sharepoint using timer job. For this i want to check if a specific ...
Ishan's user avatar
  • 774
4 votes
1 answer
445 views

sharepoint 2010: javascript rest api not returning full decimal values, truncating to tenth

I have a list with a several columns that have number values to fourth decimal place, and I am using javascript com to get data via rest GET request and following simple callback function ...
Justin's user avatar
  • 1,361
0 votes
2 answers
5k views

Defer SP.RequestExecutor.executeAsync

I'm working on a SharePoint app where I need to run SP.RequestExecutor.executeAsync() in order to grab some information from one of the Host Web's lists. Depending on what method is calling the oData ...
EHorodyski's user avatar
  • 1,104
1 vote
2 answers
2k views

Changing link target to _blank has no effect

On my masterpage I have added the following script: function replaceLink() { var elems = document.getElementsByTagName("a"); for(i in elems) { var elem = elems[i]; if(elem....
Muepe's user avatar
  • 197
1 vote
1 answer
858 views

Create a Document Library with column values programmatically with Javascript

I need to create a Document Library and assign it columns with Javascript. I've been searching around and I found the SP.ListCreationInformation documentation. Here is my code so far: function ...
Scott Petersen's user avatar
1 vote
2 answers
1k views

jQuery.noConflict() and Sharepoint 2010 WebParts

I've made two webparts for Sharepoin 2010 with jQuery plugins fancybox (slider) and cycle (slider). I need to locate both webparts on one page. But it doesn't work. I tried to use jQuery.noConflict() ...
Max Zhukov's user avatar
4 votes
2 answers
2k views

Object #<Object> has no method 'showModalDialog'

Consider the following code: var options = { title: 'Create a new Post' autoSize: true, url: url } SP.UI.ModalDialog.showModalDialog(options); The code is executed from a ECB custom ...
int32's user avatar
  • 478
1 vote
1 answer
1k views

Column not found when creating list item with Javascript

I am making a SharePoint app with javascript. I am trying to add a list item to a list I have defined in Visual Studio. I have done this just by adding a list in the solution explorer, and I made ...
Ole-M's user avatar
  • 111
0 votes
1 answer
2k views

Adding a custom delete button to a custom list form in SharePoint 2007

On a customized dispform.aspx page for document library, I'd like to add a delete button. I'm trying this code from SharePoint Designer, but getting error in sharePoint designer 2007 A string ...
Hell.Bent's user avatar
  • 1,299
2 votes
1 answer
267 views

What is the id of the close button on a modal dialog?

I have a modal dialog and I want to change some of its properties through javascript. I have found the jquery code jQuery("a[id^='DlgClose']") but when I try to use the javascript document....
Dan S's user avatar
  • 21
0 votes
1 answer
5k views

Why, on occasion, does executeQueryAsync() fail to execute success OR failure method?

My intent is to dynamically create a grouping of EditControlBlock (List Item Menu) custom actions for two different list view pages. Upon loading the Active page, all custom actions are destroyed, ...
adnauseam's user avatar
  • 161
0 votes
1 answer
440 views

How to call ExecuteOrDelayUntilScriptLoaded(MainFunction, "sp.js"); in button Click event of javascript?

Can i able to call the ExecuteOrDelayUntilScriptLoaded(MainFunction, "sp.js"); in the button click event of javascript or jquery Is it Possible? Thanks
madhan's user avatar
  • 269
1 vote
1 answer
20k views

How to reterive list item values using CAML query?

I have one Date and time column and text colum. I need to retrieve list item value based on this both column using CAML query.. For ex: Columname---> Date value for date would be-6/1/2013 and ...
madhan's user avatar
  • 269
1 vote
2 answers
398 views

Client Side Error Reporting and Instrumentation in SharePoint 2010/2013

I do a large amount of client side development using SharePoint as the back end. In most cases I rely heavily on the REST API and JSOM. I tend not to use the SharePoint masterpages and deploy my ...
Robert Kaucher's user avatar
1 vote
1 answer
4k views

SP2010 JSOM: updating with CAML where clause

So I learned and have used the following to update a list item by ID using Javascript Client Object Model: function updateItem(passedID) { var ctx = new SP.ClientContext.get_current(); var myList = ...
Justin's user avatar
  • 1,361
0 votes
0 answers
637 views

print function is not working fine with the script code

` .styled-button-2 { -webkit-box-shadow: rgba(0, 0, 0, 0.0976562) 0px 1px 0px 0px; background-color: #EEE; border: 1px solid #999; color: #666; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, ...
Arul's user avatar
  • 133
0 votes
4 answers
5k views

How to get the list item column values based on the html drop down and display in the alert box using Javascript?

I have a html dropdown list(team name) which contains three values A,B,C I have a sharepoint 2010 List A which contains Team name and Email. List A Teamname Email A [email protected] B ...
user17813's user avatar
1 vote
2 answers
4k views

How do I delete potentially many items from more than one list using JavaScript?

I'm trying to use a script to remove multiple list items from multiple lists. I'm using Javascript because I don't have access to Visual Studio. The idea is there's a Parent List item in a ...
adnauseam's user avatar
  • 161
6 votes
2 answers
6k views

SP2010 REST API from Javascript: how to set multiple fields to filter on in the URL

weird but i can't figure this out or find a solution anywhere.... I want to filter on two values on a GET in REST URL from javascript. So since this is from ECMA I am just using filtering in the url.....
Justin's user avatar
  • 1,361
3 votes
1 answer
1k views

GetListItem - Get Distinct Values for Dropdown

I am Passing the XML for getting List item and binding to dropdown. Here i have shown the code.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/...
user17813's user avatar
2 votes
1 answer
2k views

How to pass arguments to SPServices function request?

In SPServices library, I make a search request using: $().SPServices({ operation: "Query", queryXml: queryText, completefunc: searchComplete }); function searchComplete(xdata, status) { ...
omega's user avatar
  • 2,160
4 votes
1 answer
1k views

SP2010 possible to create a text file in document library and fill with data from list using JSOM JavaScript/jquery

Is it possible to create a new item in a library and default that to a txt file or XML and using JavaScript or jquery insert data from a list into that file? For example from a page click a button ...
Justin's user avatar
  • 1,361
3 votes
2 answers
8k views

Why is this CAML Query returning all items regardless of the <Where> element definition?

I'm trying to retrieve a list of items where a specific field matches a specific value. There is likely going to be multiple items returned when the query is successful. Here's what my CAML query ...
adnauseam's user avatar
  • 161
1 vote
1 answer
254 views

Search problem - JavaScript SubmitSearchRedirect - WSS 3.0

I am trying to search using the default search control from sharepoint. <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"> <SharePoint:DelegateControl runat="server" ...
Tito's user avatar
  • 291

1
91 92
93
94 95
108