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
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 ...
7
votes
2answers
1k views

How do you stop scroll position maintained after postback on lists?

I have a list with paging enabled and a page size of 10. When you scroll to the bottom of the page hit the next button in the list the page redirects to itself with different querystring parameters ...
2
votes
2answers
437 views

Branding SharePoint 2010 CSS and Javascript - Training Courses?

I've been tasked with branding our new corporate website which will be on the SharePoint 2010 platform. Is anyone aware of some good training courses in the UK that might be able to help on the CSS ...
3
votes
3answers
3k views

Sharepoint - Calculated Column showing different colours based on list item age

Marc, I understand you are a busy man, but if you can spare atleast sometime to my query below then I will really appreciate the gesture. Background: We get several requests (items on SharePoint ...
3
votes
2answers
2k views

Programmatically add Event to Sharepoint Calendar using Client OM

I need to programmatically add events to a SharePoint Calendar and make them repeatable using JavaScript Client Object Model (without any c# code). Does anybody have ideas how can I implement this ...
1
vote
0answers
490 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 ...
6
votes
1answer
849 views

Get and remove all currently displayed notifications from SP.UI.Notify

I am sending a variety of notifications via SP.UI.Notify.addNotification("blah", true); setting the "sticky bit" to true so that the notification stays visible. When I display a second ...
2
votes
3answers
3k views

Set SP.UI.Status or SP.UI.Notify at PostBack

I use in my web part a Session[""] and would like to notify the user when the session is expired. I check at the PostBack event if the session is already okay, if not, I will execute a JS function ...
1
vote
2answers
2k views

Displaying the item version history programmatically using Javascript

I have a SharePoint 2007 list that have version history enabled. I am interested to know how do I view the version history of a item using Javascript (or JQuery).
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?
3
votes
1answer
2k views

REST API + Expand Recurring Calendar Events?

Is there a way using the REST API (through javascript) to expand recurring calendar items? Or is there a helpful client side utility to assist with this?
1
vote
3answers
2k views

__redirect not working after __commit on Form Action Button

This is in Sharepoint 2007 -- Designer I have written a Form Action button and it has the following Code: <input type="button" value="Add List Item" name="BtnSave" onlick="javascript: ...
0
votes
3answers
504 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 ...
1
vote
2answers
154 views

Tooltips on check boxes

I have a CheckBoxList , I want to assign tooltip to all the checkboxes. How is it possible? I cannot find any property associated with this. <asp:CheckBoxList ID="XYZ" RepeatColumns="3" ...
9
votes
1answer
527 views

Detecting browser and replacing web part?

I have a video I want to display on my SharePoint 2010 public facing site and at the moment I am using Silverlight, however, I would like to replace this with flash (youtube actually) if the users are ...
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 ...
1
vote
1answer
83 views

Can someone explain the ULS18u function that appears in the main pages of some site collections?

This function is then used throughout the page for various reasons. Usually it appears as the first line in other java-script functions. As an example: function toggleBlockOn(elementID) { ...
2
votes
1answer
412 views

Access My Content using ecmascript client OM

Is is possible to access the current user's "My site" and "My Content" using the ecmascript client OM? Specifically I'm looking to create a custom list, that is specific to each user, and wanted to ...
3
votes
1answer
2k views

Getting date and time from SharePoint Server 2007 and throw it to Javascript variable

How to I get the date and time from SharePoint Server 2007 and pass this value as a Javascript variable?
5
votes
4answers
10k views

Closing a modal dialog using a custom form

I am using some JavaScript (Client OM) code to open a dialog. Here's a snippet: function OpenModalForm() { //snip var opt = { url: url, width: 800, height: 600, ...
4
votes
3answers
6k views

Sharepoint 2010. 'xsd is not defined' Error when trying to save edited list item or create new! IE9

In internet explorer 9 i have error when trying to save list item. Namespace prefix 'xsd' is not defined. Before that i have javascript error inside some sharepoint files. This error says really ...
8
votes
1answer
4k views

How to get a list of all Choice field options using Client Object Model

How would you get a list of all the possible choices from a choice field (e.g. Task list Priority or Status fields) using javascript client object model?
1
vote
2answers
1k views

javascript window.open() to a html file opens the browser download dialog

I'm creating a print (preview)window, for which I want to load the core html from the site assets: The code: ...
8
votes
3answers
12k views

How can I use the SharePoint Javascript Object Model from a plain HTML page?

I would like to use the SharePoint Javascript Object Model from a "plain" html page (ie, not an .aspx application page etc.) Is this even possible? If so, what scripts should I reference? I've added ...
0
votes
1answer
161 views

Available web part width

Is it possible to find out the available web part width in px via JavaScript? Because I need to set the size of a component manually.
1
vote
1answer
81 views

Is it possible to use the Javasciprt client object model from a different web server?

Basically I would like to host an application on a different server than my SharePoint server. Using the managed client object model I have been able to access data on my SharePoint server, but I'm ...
0
votes
1answer
154 views

Access different site collection using client OM

I have written a little app, which makes use of the ECMA client OM. I need to access from a site-collection "/sites/subsite" a list, which is located on the site-collection "/". However, this shows a ...
5
votes
1answer
494 views

structure of sharepoint javascript functions

I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js: ...
1
vote
1answer
552 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 ...
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
511 views

Building a Floating Menu for SP 2010

I would like to have a floating menu the menu can come from a list or use the Quick launch. Any ideas or samples out there.. For example if i can make this float ...
3
votes
2answers
1k views

Web Service UpdateListItems User Permissions

I'm trying to do an AJAX SOAP call to the Lists web service, specifically UpdateListItems. The query isn't malformed, and is working appropriately when using a user with full permissions. When a ...
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 ...
1
vote
4answers
164 views

Showing url images in webpart

I need to display the images of the url typed in a custom webpart . i.e if i type url name (www.google.com) , atomatically it should display the small logo of google in webpart .Anyone with this idea ...
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
2answers
756 views

Custom Delete Page Button

I'm trying to create a custom delete page button for my users on a publishing site that resides on the actual page. At first I thought it would be as simple as just copying the code behind the 'Delete ...
0
votes
1answer
142 views

Issue with editing SharePoint Page

I have an issue with editing a Sharepoint page. I have to check whether Silverlight is installed in the user's system which is done by a Javascript function, but the issue I'm getting after ...
0
votes
1answer
638 views

Put Easy-Tabs in page layout rather than CEWP

Another question about the fantastic Christophe Humbert Easy Tabs library: Can the library be included in a page layout for a publishing site rather than in a content editor web part? This way it's ...
0
votes
1answer
546 views

Add a JS file as embedded resource in a web part in VS2010

I am trying to add resources JS files, images, CSS files as embedded resources to my custom web part, I am writing in VS2010. I have set the properties of these files as "Embedded Resources", but I am ...
2
votes
2answers
225 views

SharePoint 2010: blocking the screen on load

We are hosting some SP2010 sites and some of our users are a little quick on the trigger and try to click on an order before the page is done loading, inadvertantly approving it by mistake. Repeated ...
1
vote
2answers
3k views

PreSaveAction is not firing

Any idea why the PreSaveAction is not firing. I am trying to take the user to a thankyou page when they complete a survey. I added this js thru SP Designer to NewForm.aspx. <script ...
9
votes
2answers
9k views

Programmatically add JS/CSS to pages

I've created a Visual Studio SharePoint 2010 solution with an ASCX that adds some JavaScript files and CSS to the head of each page; this is based on this article. When I deploy the solution, it adds ...
0
votes
2answers
493 views

Link in master page to base url

In a WebApp with diffrent site collections and subsites, I would like to add a link on the custom master page of all sites to the WebApp Url. (This Url is corresponding with a home/top site ...
7
votes
1answer
4k views

Get a value included from a lookup column using the JavaScript Client Object Model

Related: How to retrieve a ListItem using the Javascript Client Object Model? In my previous question I was able to successfully retrieve a basic value from a list item. My problem is that I am now ...
5
votes
5answers
790 views

How can I include jQuery and JavaScript code without straying from the site template?

I've added my JavaScript code by including the script links in the PlaceHolderAdditionalPageHead <asp:Content> tag. Including this has caused a yellow warning stating The current page has ...
3
votes
1answer
2k views

How to import external javascript in a User Control?

I have a code-behind User Control (myUserControl.ascx and myUserControl.ascx.cs) that are in ControlTemplates/MyFolder/ and, in the code of myUserControl.ascx I need to use some javascript ...
1
vote
1answer
8k views

How to retrieve a ListItem using the Javascript Client Object Model?

Right now I am using this method: function getWebProperties(id) { var ctx = new SP.ClientContext.get_current(); this.website = ctx.get_web(); this.listCollection = website.get_lists(); ...
0
votes
1answer
116 views

Proper way to retrieve list data asynchronously?

I have done this in the past using jQuery's ajax function and the SharePoint web services, but I'm curious if it is considered a better practice to use the Javascript Object Model? Also, is it secure ...
2
votes
3answers
100 views

Best Practice: Javascript Registration SP2007

There is always the ASP.net way of registering javascript on the page using the Page.ClientScript.RegisterClientScript() method, but I was wondering if there was a better way to register your ...
1
vote
1answer
512 views

Select item from popup window and return the url to the parent window

I'm having a tricky problem which I can't solve with the AssetUrlSelector since it won't pass parameters. This code works except for the parameter: <xsl:variable name="CurrentProductCode" ...