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
1answer
439 views

How to get server datetime without postback using JSOM or services

My application page may be long time without reloading, and user changed system date and time. And I need to know datetime from server, not from client.
1
vote
0answers
383 views

List Item file attachment using ECMAScript Object Model

How to simply upload & attach file to listItem using Javascript? And how to get/download attachments.
1
vote
1answer
350 views

SharePoint 2003 PreSaveAction() to make attachment required

I asked this question in the main SOF forum but I think it belongs here. http://stackoverflow.com/questions/10415929/sharepoint-2003-presaveaction I need to add a little JavaScript to run when user ...
1
vote
0answers
487 views

Get Permissions with client object model

i want to add a permission on a folder who's inside a document library with javascript/jquery/client object model. The problem i have is, its a custom permission level created when some feature is ...
1
vote
2answers
1k views

Sharepoint Ribbon: Circumventing Context sensitivity

First of all, I've asked this same question on StackOverflow. I don't know if questions asked there are visited by users here and vice-versa, so in hopes that my question gets the most exposure, I'm ...
1
vote
2answers
1k views

Microsoft Ajax Framework & SharePoint 2010 'Type' is undefined JavaScript error

Recently in SharePoint 2010 I've been seeing this stupid 'Type' is undefined error loading the Microsoft Ajax Framework. Now can anyone shed some light into what would cause this to start happening ...
1
vote
0answers
45 views

How do I get count of list item collection items with javascript? [duplicate]

Possible Duplicate: Getting a count of list items in a list via ECMAScript I found something, it works, but it's not nice. var items; ... var enumerator = items.getEnumerator(); var count = ...
1
vote
0answers
265 views

Customizing richtextbox from formfield

This applies to SharePoint 2010. I have a requirement where users can only use a very specific set of "styles" when creating their content for SharePoint lists. As the "styles" ribbon button does not ...
1
vote
0answers
196 views

SPServices to retrieve the last record of repeated section data inside Sharepoint library

I have a Infopath that contain 2 fields which I put it as a repeating section as shown in the picture below (for the time being - please ignore the error) How do I retrieve the last record of a ...
1
vote
0answers
491 views

get current Page Layout in sharepoint 2010 using ECMA script

I have a requirement that I need to create a custom page layout and need to update the current page layout with my custom page layout. In SharePoint we have a feature to change the page layout. But I ...
1
vote
1answer
557 views

Problem with expanding/collaping gridview rows in Firefox

I have an asp:Gridview control called gvComments that uses the following Javascript to show/hide table rows. If the expand/collapse button is clicked, a string (EventID) is passed to the function and ...
1
vote
0answers
469 views

Get group membership of current users using ECMAScript [duplicate]

Possible Duplicate: How do I determine a user's SharePoint group membership using the client object model? How can I use the client object model to get a list of all (SP) groups the ...
1
vote
2answers
543 views

SharePoint Approval Workflow Javascript error

I've been trying to create a simple Approval Workflow in SharePoint (MOSS 2007). After going through the first screen where I type in the name, Task List, History List, startup params, etc. I go on ...
1
vote
3answers
2k views

Sharepoint- Client Object Model - Javascript - How to check if a particular file with same name exists in a document library folder

I am using javascript sharepoint 2013. I want to know how to check if a file exists in a folder, before i upload. Here's my code // Folder Name - folder into which I need to upload var ...
1
vote
2answers
688 views

How to use SPServices search sql query - getting malformed query

I am using the SPServices javascript library to make a search request to sharepoint 2010 search. I am trying this query: queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' ...
1
vote
1answer
315 views

Javascript IIFE and SharePoint Client Object Model

I'm having a problem with my javascript code that I am sure is to do with scope, but I can't figure out where I'm going wrong. I'm trying to write a method that will allow me to retrieve items in a ...
1
vote
3answers
4k views

Sharepoint DateTime control, how to call client side as well as server side on datechanged

I am having a datetime control in sharepoint custom webpart <SharePoint:DateTimeControl runat="server" ID="txtUKdtofAdm" LocaleId="2057" DateOnly="True" ...
0
votes
4answers
2k views

JQuery in a Visual WebPart won't load on the page with the webpart

Hey I have a bunch of JavaScript/Jquery code that works really well when I use a Content-Editor webpart, but does not execute when I add the same code to the VisualWebPart mark up. I am referencing ...
0
votes
3answers
232 views

Get the id value from the page url

In SharePoint how do you get the ID value from the url of the page you are on using javascript( Jquery,ajax, Rest..), e.g. I have the url like so: http:// ddd/mypage?ID=xx I tried before to ...
0
votes
1answer
84 views

Script in webpart freeze the whole site

I have a JavaScript in my script editor that on page load freezes the browser . I can't use SharePoint designer to remove it because the script is in a script editor. I have tried disabling JavaScript ...
0
votes
2answers
4k views

How to correctly get a JavaScript SP.Web object's ID and URL before loading

I was working on a project where I needed to get the current web's ID or URL (sometype of unique identifier) in javascript without making an service call (executeQueryAsync). I didn't seem to be able ...
0
votes
2answers
331 views

CAML query multiple values javascript

When I run the following query I get an error: <View><Query><Where> <Or><Eq><FieldRef Name='ID'/><Value Type='Number'>164</Value></Eq> ...
0
votes
1answer
1k views

SP2013 “_spUserId” is undefined

As we migrated our solutions and scripts from SP2010 to SP2013 my script ran into some weird error where I could not fetch the current logged in user with "_spUserId" anymore. var user = _spUserId ...
0
votes
2answers
1k 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 ...
0
votes
5answers
3k views

JS/jQuery Check if on root web of root sitecollection

How is it possible to check in JS/jQuery if the user is on the root site of the root sitecollection in the webapplication? (Sharepoint 2010) Thanks! Example: ...
0
votes
2answers
892 views

Get web config setting value in javascript

Best way to get from a custom action js command an webconfig appsetting key value, or another similar approach. ideas? thanks. Reference a .js file on a custom action elements.xml on my ...
0
votes
3answers
5k views

Get the user id via javascript

How can you get the current users id using javascript? Can you do this any JS file or does it need to be added at a certain point?
0
votes
1answer
4k views

getting list using JavaScript, error: Unable to get property 'apply' of undefined or null reference

In the context of a page in SharePoint 2013, I am trying to get items from a list using below code but when the query executes I am getting this error: SCRIPT5007: Unable to get property 'apply' of ...
0
votes
4answers
3k views

Object doesn't support property or method 'get_item'

When i try with this code i got error Object doesn't support property or method 'get_item' . Please help me to resolve function showTitles(urlColumnName) { var selectedItemIds = ...
0
votes
2answers
4k 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 ...
0
votes
2answers
511 views

client object model and jquery not loading — sort of

I'm getting some data from a list via the client object model. After I get the list data, and the page loads, I want to use a little jquery to add a hover effect. Easy enough, right? Well ...
0
votes
2answers
2k views

Include javascript on application pages

I need to do some client-side alterations to some of the application pages, specifically the permission page (User.aspx). I need the javascript file to remove the "Administrate Parent Permissions" ...
0
votes
3answers
3k views

Setting display:none for empty web part zones

Does anyone know the JavaScript for setting display:none on an empty web part zone? I remember seeing it once on a publishing site but now can't find it. This is to avoid the padding and spacing a ...
0
votes
2answers
30 views

How to get app url?

I'm creating a javascript app for sharepoint, and I need to get the url of this app. The same url that is in content of site. I need another solution because when i try to simply reload the page with ...
0
votes
3answers
26 views

Issue in calling the function using ExecuteOrDelayUntilScriptLoaded()

I am facing issue while calling the function using ExecuteOrDelayUntilScriptLoaded() I am writing like: <script language="javascript" type="text/javascript"> ...
0
votes
2answers
191 views

JS ClientContext return undefine when deleteObject

I'm trying to delete a list item from a SharePoint library via JavaScript with ClientContext. Unfortunately I don't have access to the ID of the item that's why I use the Title and I can not delete ...
0
votes
2answers
192 views

Get SP.ListTemplateType enum value using JSOM

I am trying to create a new list (based on a dropdown menu selection) using JavaScript Client Side Object Model. var typeList = "SP.ListTemplateType." +listTemplateType; ...
0
votes
2answers
5k views

Uncaught TypeError: Cannot read property 'get_current' of undefined

this one is weird I hope somebody can help me. I created a custom action for a callout on a document library. I added the javascript code in a code snippet webpart on top of the document library ...
0
votes
3answers
113 views

Does SharePoint 2010 support HTML5, createJS elements?

I'm trying to embed HTML5/createJS in a SP Content Editor Web Part. On my browser (Chrome): In SharePoint (Chrome): The background CSS renders, but not the createJS/HTML5 elements (canvas): Any ...
0
votes
4answers
359 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 A@test.com B ...
0
votes
2answers
110 views

Javascript doesn't work for the users except System admin

Javascript doesn't work for the users except System admin. I checked in all files. And everyone can view the pages and sites. How can I solve this? <script type="text/javascript" ...
0
votes
1answer
2k views

SP.Web.EnsureUser(user) does not seem to work. (JavaScript Client OM)

Supposedly, SP.Web.ensureUser(user) works according to this MSDN link but I cannot seem to get it to work in my JS code. While debugging, I can see that SP.Web exists and the user variable is ...
0
votes
1answer
3k views

How to read URL/Description from a Hyperlink field using CSOM

Using CSOM (JavaScript) how do you get the URL and description fields from a Hyperlink field?
0
votes
3answers
325 views

Hide Sidebar on _layouts pages

I am trying to hide the sidebar on administration pages in SP 2010. To do this, I am trying to use the following Javascript code which does not seem to be working. $(document).ready(function () { ...
0
votes
4answers
2k views

How to verify in Javascript Object Model if a List Exists

How can I verify if the list I'm trying to retrieve in Javascript really exists? My code is: function Search() { var context = SP.ClientContext.get_current(); this.site = context.get_site(); ...
0
votes
2answers
97 views

c# and JavaScript

So i have this code sb.AppendLine( "var nameSplit = users[i].split('\');"); The sb.AppendLine is C# and the bit inside is JavaScript, I am trying to split users[i] so that I can strip out the ...
0
votes
2answers
5k views

SharePoint 2010 - pull value from SharePoint list and pass through HTML link

I have a list with a column that contains a url. For exmaple: --LIST-- ID Name URL 1 MSN http://www.msn.com -- Now, what I need to do is pull the value in the ...
0
votes
2answers
3k 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
3answers
510 views

SharePoint redirect to add parameter

I want to add a parameter "Force=True" when the user is redirected to userdisp.aspx (when you click on people's name) What is the best way to do it? Details: I need that because I do not have a ...
0
votes
3answers
73 views

get the attachement files from REST API

I use REST API SharePoint 2013 to get the items from list: And and I want to get the Attachments Files, How can i do that? This the code : function getListItems(url, listname, query, complete, ...