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)

4
votes
3answers
200 views

JavaScript is breaking my theme in SharePoint 2013

I am having an unusual problem. I have a site in SharePoint 2013 I just stood up, and starting to experiment with JavaScript and jQuery. I am using one of the OOTB themes, not ready to monkey around ...
4
votes
1answer
155 views

What is ULS2Vv:;?

I see that label in most SharePoint JavaScript libraries. I am curious - what's that used for? Example: EnsureScriptFunc("clienttemplates.js", "RenderUserFieldWorker", function () { ULS2Vv:; // ...
4
votes
1answer
3k views

Sharepoint 2010 Calendar View in Custom List Expand All by Default

For some reason the scripts I have found on the web (ie: http://social.msdn.microsoft.com/Forums/en-GB/sharepoint2010general/thread/a24da49a-7fc8-47c6-a125-95e4a5b2d095) are not working with a ...
4
votes
2answers
2k views

How to read a column type SPUser, DateTime, Currency with EcmaScript?

I have a list in SharePoint 2010 with some columns. All are default types. So I have "Single line of text" "Multiple line of text" "Date and Time" "Choice" "Number" "Currency" "Person or Group" ...
4
votes
1answer
2k views

JavaScript error using date picker inside an update panel?

I placed the SharePoint date picker control inside an update panel and when I click on the calendar it gives me this error: Microsoft JScript runtime error: The value of the property ...
4
votes
2answers
335 views

Dialog Framework References

One of the new features in SP 2010 is the dialog framework, so that the user is presented with a uniform UI. What are the best references or tutorials you've seen about this feature? So far, this is ...
4
votes
2answers
752 views

ddwrt:EcmaScriptEncode Explained?

Does anyone know exactly what ddwrt:EcmaScriptEncode does? (Which char mappings, etc.?) M.
4
votes
1answer
138 views

SharePoint 2010 - Using REST to validate unique list item

I'm attempting to validate that a duplicate combination of staff (person/group field) + parent ID (lookup field) does not already exist in a list. Below you can see that I've added an ajax call to the ...
4
votes
3answers
1k views

Check an Admin account only using Javascript?

Could anyone suggest a way to use Javascript to check whether or not the logged in user to a SharePoint site is Admin? We need to hide some of the SharePoint's MasterPage ContentPlaceHolders if the ...
4
votes
1answer
303 views

SP.UI.Status anonymously inaccessible

Using Office 365 (SharePoint Online) I have stumbled into an annoying thing. Some parts of the JavaScript CSOM does not seem to be accessible when your browse the site anonymously. If Firstly I tried ...
4
votes
2answers
4k 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 ...
4
votes
2answers
649 views

How to change webpart custom property in sharepoint 2010 using javascript?

I want to change Custom Property of Webpart using javascript. Does anyone have any ideas on how to accomplish this?
4
votes
2answers
3k views

Trying to redirect after closing Modaldialog, but parameters aren't set

I have a layouts page which creates a new site. I use SP.UI.ModalDialog to show the site. I've created the following js function I use to pop it up: function PagePopupAndRedir(fileUrl, fileTitle, ...
4
votes
5answers
3k views

Retrieve All list items with AngularJS and ClientContext

I would like to ask you if there is a possibility to use ClientContext with AngularJS? In this way I want to take all items, sort them, filter, make some modification and etc. Later maybe I will add ...
4
votes
3answers
976 views

Unable to set “End Time” of Calendar through Javascript

I am trying to set default value of "End Time" field in Calender NewForm.aspx page. Here is my code: var txtDate = $("#" + $("label:contains('End Time Date')").attr("for")); var cboHours = $("#" + ...
4
votes
2answers
193 views

Is it possible to Fire event when Content type added in Shared Documents in sharepoint 2010?

How to fire event when any content type added in shared document library ? How to handle this event ?
4
votes
2answers
2k views

How to get the ID of the list item just inserted using SP.UI.ModalDialog.showModalDialog

If I am using JavaScript Client Object Model and SP.UI.ModalDialog.showModalDialog to display a form to enter a new list item, how can I get the ID of that item after its been added? Example ...
4
votes
1answer
593 views

disabling javascript from overriding breadcrumb navigation styling

I've used some CSS to restyle the titlebar breadcrumbs in a SharePoint 2010 mysite. .s4-title h1 a, .s4-title h2 a, .s4-titlesep h2, .s4-title h2, .ms-ltviewselectormenuheader .ms-viewselector a { ...
4
votes
3answers
4k views

How to get SP.Folder for SP.ListItem in SharePoint 2010 JavaScript Client Object Model?

I have a custom button on ribbon for document library and need to disable it if current SPListItem is an empty folder. To disable button I use EnabledScript attribute of CommandUIHandler. I can get ...
4
votes
1answer
518 views

In SharePoint 2010 how can I add user selected WebParts at run time?

I am quite new to SharePoint and have been given an interesting problem to solve. My users have requested to each have a custom home page that they can customise with ease. The design I have been ...
4
votes
1answer
925 views

Using SharePoint 2013 Cross-Domain Library in a simple web page: is it possible?

I have a web page hosted on a server, say at http://SVR1/path/index.html, and I would like to access some list items in a on-premises SharePoint site hosted on another server, say at ...
4
votes
2answers
414 views

Check if logged in user is member of AD group with ECMA script SharePoint 2013

There is active directory group added to SharePoint group. How would we can check that the logged in user is member of that active directory group using ECMA script?
4
votes
1answer
2k views

“The XSS Auditor refused to execute a script in…” from Chrome when using <script> tag in content editor webpart

Embedding javascript in a content editor web part triggers XSS Auditor error in Chrome when editing any webpart on the page containing the content editor web part. Steps to reproduce 1 - Use newest ...
4
votes
1answer
240 views

Getting error while uploading multiple files in sharepoint hosted app in 2013 with REST API

In one of my tasks,i was struck with one issue,that is "While uploading multiple files into document library with REST API". Iam trying to upload multiple files in library with REST calls for an APP ...
4
votes
1answer
284 views

SP.ScriptHelpers object

Just noticed the object the other day, and it looks like its on every page. But I can't find any documentation about it. Anyone used the "helpers" or seen any docs, or knows anything about it? Tbh ...
4
votes
2answers
266 views

How can i add a custom tab to a ribbon at runtime using javascript/ECMAscript?

I'm trying to add a Custom tab with a group and some buttons to a single client via conditional javascript, as far as i can tell this is all found in the CUI namespace, however documentation is hard ...
4
votes
2answers
1k 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 ...
4
votes
1answer
145 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 ...
4
votes
3answers
994 views

Commit modal dialog and then display notification

I have a modal dialog that I commit by calling window.frameElement.commitPopup(), and this is great because it refreshes the parent window. However I would also like to display a notification on the ...
4
votes
1answer
204 views

SharePoint XML Web Part dynamically adding xml link

Is there a way to dynamically insert a variable in the <XMLLink> --variable here--</XMLLink> tag? I'm trying to read an URL parameter which will contain the xml files path. What I am ...
4
votes
2answers
3k views

Copy file using javascript client object model - new version

I have a solution that adds a custom button to the ribbon in SharePoint 2010 and am using the javascript client object model behind the scenes to copy a file from Library A to Library B when the ...
4
votes
2answers
835 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 ...
4
votes
1answer
246 views

Getting ctx for a specific webpart

My goal is to replace a text in a specific column by an icon using only javascript. function ReplaceTxtbyIcn(targetWP, targetColumn, pat, urlname) { var table = document.getElementById(targetWP); ...
4
votes
1answer
587 views

List Picker Dialog

I am attempting to use LaunchPickerTreeDialog js method to launch the OOTB SharePoint list picker. It works fine when selecting a list within the current web application however if I pass a parameter ...
3
votes
6answers
4k views

Enforce Drag and Drop documents to apply metadata

We have implemented an issue management system in SharePoint 2013 which provisions a page for every issue added to a specific list. One of the Web Parts the automatically provisioned page contains ...
3
votes
2answers
605 views

SP 2010 JavaScript events

I want to hook into certain events on a SharePoint 2010 site, specifically the modal dialog open and close events. Does SharePoint 2010 trigger any events for these kinds of actions? If so, how do I ...
3
votes
3answers
8k views

Get User via JavaScript Client Object Model

Is there a way to get user information via the JavaScript Client OM? Something similar to the clientContext.Web.EnsureUser(userName) method. I am aware that there is the SPService JQuery library, but ...
3
votes
5answers
5k views

SP.ClientContext is always “undefined” in JSLink functions

I'm trying to execute CSOM functions as part of a JSLink extension to override rendering of a Lookup Field. Problem is every time I try to access SP.ClientContext it returns as undefined I have ...
3
votes
2answers
19k 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 ...
3
votes
3answers
7k views

Why does jquery's document.ready not fire?

In my master page, I have attached jQuery along with my own custom.js. I use the javascript in that file to run fixes on my pages such as style adjustments. Now, when I run simple functions on my ...
3
votes
2answers
3k views

SPservices to retrieve version history of items in SharePoint List 2007?

May I know how can one use SPServices to retrieve all the version history of a particular items in a SharePoint 2007 Server List? (If it is not possible via SPServices, are there other Javascript ...
3
votes
2answers
4k views

Path to jQuery file for SharePointWebControls:ScriptLink

I'm working in SharePoint 2010 Designer to create a custom page layout. I've added a SharePointWebControls:ScriptLink control but am not sure what the path is to my jQuery library. It's uploaded to ...
3
votes
2answers
286 views

What are the advantages of using SP Services?

What advantages would I gain by using the SP Services library in SharePoint releases 2010 and later? The 2013 (and even the 2010) JavaScript Object Model and REST API seem to cover a significant ...
3
votes
2answers
526 views

Copying files AND folders via REST/Javascript

I'm trying to build a the following functionality into a library view: Each document has a checkbox beside it User checks off which documents/folders they want to copy User clicks a "Copy Files" ...
3
votes
1answer
1k views

Reference JScript files at the end of page using ScriptLink Tag

Due to performance problems, we decided to reference javascript files at the end of the master page file. However, if we reference javascript files at the end of master page using ScriptLink Tag, the ...
3
votes
1answer
916 views

JS CSOM in Custom .HTML File

I am building a SPA using SP 2010 as my back end but with custom HTML/CSS/JS deployed to a subfolder of _Layouts. I get everything I need from ListData.svc with the exception of the current logged on ...
3
votes
3answers
2k views

Adding notification from server side, code ignoring ExecuteOrDelayUntilScriptLoaded

I'm trying to add a UI notification from server side. To do this, I've written this code in one of my code behind event handler: private void AddNotifySuccessScript() { var ...
3
votes
1answer
2k views

How to add Client Web Parts (App Parts) to a page from JavaScript CSOM?

We're working on a custom way of adding and deleting Web Parts and App Parts to a page in SharePoint 2013. We have to use the new App way of developing and all code has to be using the JavaScript ...
3
votes
1answer
2k views

access a list in a subsite with Javascript

How can i access a list in a subsite? function Read () { var caml = "<View><ViewFields><FieldRef Name='Title'/><FieldRef ...
3
votes
2answers
1k views

Get UI language name in javascript

I need to get the name of the current UI language in a javascript file. I know the following trick: SP.Res.lcid But that gets the the LCID. What I really need is the two-letter iso name (like 'en', ...