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
342 views

How do you handle Javascript/CSS packaging/minification/auto-versioning in SharePoint?

Packaging: Taking file1.js and file2.js and combined them together to make file3.js Minification: Using things like JsMin or YUICompressor Auto-Versioning: URL has /scripts/file2.js?v=123456
6
votes
7answers
6k views

What is the proper way to add jQuery to a MasterPage?

Currently I am using this method in the header: <script src="/_layouts/MNCAssets/scripts/jquery-1.5.1.min.js"></script> But for some reason, my webparts that use jQuery don't appear to ...
0
votes
0answers
70 views

Is the javascript in my webpart executing before the javascript in my MasterPage? [duplicate]

Possible Duplicate: What is the proper way to add jQuery to a MasterPage? I have a few webparts that use jQuery. Instead of adding the jQuery in each web part I decided to add it in the ...
2
votes
2answers
5k views

How do I get the number of items in a list?

I have a list with a lot of items in it I need to know the list item count the following is my code: var sListId = SP.ListOperation.Selection.getSelectedList(); var oWeb = ...
1
vote
2answers
697 views

javascript open parent window from NewForm.aspx

I have the following javascript in the NewForm.aspx. It works but opens the link in the NewForm.apsx. I need to open the link in the parent window where NewForm.aspx was initiated from. What am I ...
2
votes
3answers
6k views

What's the best slideshow viewer for SharePoint 2010? [closed]

After working with the Picture Library Slideshow Web Part for a while, I'm unhappy with it's display. On a blank wiki page, it looks fine, but when you start adding other web parts on the page, it ...
3
votes
3answers
8k views

How to get list by url using client object model?

Is it possible to get list by url using ECMA script client model? For example something like this: context.get_web().get_lists().getByUrl("Lists/MyList"); UPD!: Please, refer to this correct ...
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 ...
2
votes
1answer
1k views

Custom form validation

I am new to Infopath and Sharepoint, and have been reading everything I could find online about this, but nothing to solve my problem. We need a form with custom validation (logic in javascript) to ...
1
vote
1answer
3k views

Script Manager in SharePoint pages

I am working on some mobile web parts and have got into a problem. My issue is that I have a custom web part which is a mobile web part. I have got everything working and I can see the web part in ...
2
votes
1answer
807 views

SPListItem removing HTML attributes?

I want to add this to an SPListItem HTML field (Multiline text) <a href="#" onclick="OpenDispPage('Table 1.1', 'table');" >Text</a> and this is what SharePoint makes out of it when I ...
3
votes
1answer
565 views

Can I use JavaScript in 'Edit in DataSheet' mode?

I would like to use some JavaScript in 'Edit in DataSheet' mode to check a value and prompt a user to enter some text. Is this possible?
1
vote
1answer
3k views

Why am I getting JavaScript errors in my extended web application?

I have extended a web application in SharePoint Foundation 2010. Added an AAM from "http://servername" to "http://portal". Accessing the site with the AAM address (http://portal) will come up however ...
2
votes
2answers
4k views

Error on sp.js property 'isNullOrUndefined'?

When I try to run my javascript SP.JS file in a user control I get this error: Microsoft JScript runtime error: Unable to get value of the property 'isNullOrUndefined': object is null or undefined ...
0
votes
1answer
506 views

SharePoint CEWP Javascript works on IE8, but not Chrome or Firefox

I have some Javascript in a CEWP on a custom item display form that works fine with IE8, but not with Chrome or Firefox. The script is to hide select menu items from the display menu (mostly ...
1
vote
4answers
648 views

itemAdded event handler or javascript when a file size greater than 1MB

Easiest way to implement the 1mb limitation on file upload. Do I use event handler to take care of this or javascript? I can have the event handler ready as I have messed with it before. It is better ...
1
vote
1answer
204 views

Guidelines for rich UI?

Edit : actually, my current task is focused on the refactor of a webpart, but the question is in fact a general question : what are guidelines for "cool" SP UI. /Edit I have to maintain a set of ...
0
votes
1answer
447 views

Is there a way to get the currently logged user’s colleague list using ECMA client script?

Is there a way to get the currently logged user’s colleague list using ECMA client script? Used the below script to pull the currently logged user name: <script ...
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 ...
1
vote
1answer
682 views

Where can I find the permission details for the HasRights javascript call in core.js?

I am writing JavaScript that will show a menu item for the document ECB menu in a SharePoint document library. I want to only show the item if the current user has the ability to edit the item. It ...
2
votes
2answers
627 views

What do you do to enable Auto-Versioning of custom CSS and Javascript in SharePoint 2010?

I want to be able to auto-version these in SharePoint and I'm looking for the best solution. SharePoint does it with some of it's files. For example: <link rel="stylesheet" type="text/css" ...
1
vote
1answer
540 views

Add Image to WebControl.RichImageField client-side Sharepoint 2007

Situation: I've got a pagelayout with 3 LanguagePanels with in everyone a RichImageField. Above these languagepanels, i've got a "General info" panel with a textbox for an url. In edit mode, if I want ...
1
vote
3answers
5k views

Auto populating columns within a list?

First time user & poster here. A friend recommended me to this site for a question I have in relation to populating columns within a list. Hopefully I can explain it properly and someone could ...
1
vote
3answers
2k views

Adding item to list view context menu

SharePoint 2010 question here. I have a document library with a number of documents, and I want to add an entry to the list item context menu (the dropdown menu that contains the "View ...
3
votes
5answers
2k views

Why am I unable to save JavaScript in a Content Editor Web Part?

I am trying to follow this link and put all the code in a CEWP as suggested. After saving the page the code goes away (except for the gear part, top line). I could really use some help if possible.
3
votes
2answers
387 views

Can all the /_layouts/xxx.debug.js files not be served to end users?

I'm working with a 3rd party vendor who has done the SP 2010 integration of a small site. I've noticed that our incredibly simple login page is nearly 3.2 megabytes. The users of this site are the ...
1
vote
1answer
400 views

adding where clause in javascript

var PicLibraryURL = "/SC/SW/_vti_bin/owssvr.dll?Cmd=Display&XMLDATA=TRUE&List=%7B9D30BD4A%2DBA0F%4ED2VM%2DBEBB%2D8CEC5D74A29B%7D"; How do I add a where clause to above javascript? I have a ...
10
votes
8answers
11k views

How do I determine a user's SharePoint group membership using the client object model?

I want to redirect users from a landing page to another page in SharePoint 2010, based on their group membership. I need to do this using JavaScript (ECMAScript) and not server side code.
4
votes
2answers
3k views

Sharepoint 2010 ModalDialog title

I am creating a popup window in sharepoint using this code in javascript. function openDialog(title, url, width, height, CallResult) { var options = { url: getUrl(url), title: title, ...
3
votes
2answers
994 views

Sharepoint 2010 MdalDialog title [duplicate]

Possible Duplicate: Sharepoint 2010 ModalDialog title Hi, I am creating a popup window in sharepoint using this code in javascript. function openAutoResizableDialog(title, url, ...
5
votes
5answers
2k views

Include JavaScript in a feature

I remember seeing somewhere that you can include an external JavaScript file in a SharePoint feature if it is in the _layouts folder. For the life of me I can't remember how to do this!
4
votes
3answers
2k views

How do you allow Content Authors to add Javascript to a Publishing Page?

We have an internet-facing, SharePoint 2010, Publishing Site. The content authors that maintain the site are JavaScript savvy web designers. They would like to be able to add JavaScript to publishing ...
2
votes
3answers
5k views

Automatically fill in metadata on new document created from template

I have a custom button on my application page to open a new document from a document template, like you would do directly on a list. The code is similar to: <a href="http://Site/test/documents" ...
40
votes
10answers
21k views

How do I know if the page is in Edit Mode from JavaScript?

Is there a way to find out if a page is in Edit Mode from JavaScript? I know in on the server-side can be found using SPContext.Current.FormContext.FormMode but I can't find any means of doing it ...
1
vote
3answers
4k views

Problem with IFrames and SharePoint 2010

When having an IFrame inside SharePoint 2010, scrollbars disappears under some cirumstances depending on window size and mouse position. If holding the mouse over the address bar while refreshing the ...
2
votes
3answers
1k views

Where do you deploy scripts that are loaded in a masterpage?

Do you deploy the script files to "_layouts" or the content database? If "_layouts," do you use a <ScriptLink> tag or a <script> tag?
1
vote
1answer
387 views

Restrict additional pagehead in sharepoint popup window

hi i have added additionalpagehead in sharepoint which will run a javascript functions to show some texts. It is working fine in all the sharepoint pages but it is working in sharepoint popup window ...
0
votes
1answer
402 views

Use of owsbrows.js , core.js in sharepoint 2010 [closed]

I would like to know how "viewproperties" menu works an item in a list.I googled for sometime and found that the jscript files "owsbrows.js" and "core.js" at C:\Program Files\Common Files\Microsoft ...
0
votes
2answers
2k views

debug javascript [closed]

I have a javascript thats breaking. Now Is there a way i can call the function from content editor web part and debug to see where the hick up is?
1
vote
1answer
385 views

Sharepoint 2010 only displaying an item in the ribbon if using IE

I am using some JavaScript that can only be used in IE. Is there a way to hide my custom ribbon button if not in IE? Or only display it if it is IE.
3
votes
1answer
187 views

Getting the path of a an item on using UrlAction and JavaScript

I have a custom ECB menu item. I want to get the path of the file that has been right clicked and alert it using JavaScript. Is this possible?
2
votes
1answer
1k views

sharepoint webpart javascript - 'null' is null or not an object

I have an issue on one of my sharepoint enviriontments regarding some kind of javascript problem with the Content Editor Web Part which keeps returning me these errors when I try to user the RTF-text ...
10
votes
3answers
4k views

Site Assets vs. Style Library

I usually store my JavaScript/jQuery files in the Site Assets library, but I see on forums that others are using the Style Library. What are the respective benefits of each?
9
votes
4answers
2k views

Why does having `windows.onload` break page editing?

This is related to an earlier question that I posted: Can't edit page after adding custom web part! Basically, I have created a web part with some javascript. When I add this web part to a ...
1
vote
4answers
4k views

Why are my sub site collections not getting javascript and css files?

I have a master page deployed with a feature which has custom javascript and css references on it. I am using the <Sharepoint:ScriptLink> and <Sharepoint:CssLink> tags and the code is ...
1
vote
2answers
914 views

get all image library lists via listdata.svc or web service, how?

I want to retrive all image/picture lists a site has with javascript. Can that be done via listdata.svc or via a soap webs service? When looking at the response from listdata.svc i can't see what ...
0
votes
2answers
683 views

Possible to use an ASP.NET control value in a Javascript file used in a Web Part?

When you are coding in an aspx page you can do something like this: <html> <head> <script type="text/javascript"> $(document).ready(function () { var chkEnable = ...
40
votes
7answers
36k views

How do you get the current list item in JavaScript?

There's all kinds of ECMAScript class library examples around but all of the ones I find show how to retrieve all list items (through SP.ClientContent) but how do you get the current list item? I'm ...
1
vote
2answers
6k views

How to add a pop up aspx page to your web part?

I'd like to have a pop up that contains an aspx page. It appears that adding an aspx page to a web part is not possible. When I went to add a new item to the project the closest I could find were ...
7
votes
2answers
8k views

Adding ScriptLink for js file to my Visual Webpart causes error: “Cannot make a cache safe URL for…”

Full error: Cannot make a cache safe URL for "sprocketcomplete/layouts/sprocketcomplete/js/sprocketcomplete.js", file not found. Please verify that the file exists under the layouts ...