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

How do get selected item of list?

I have a webpart .I add a listviewbyquary in createchildcontrols and a hyperlink in visualwebpart. i use this http://graegert.com/featured/using-the-editorpart-to-create-a-custom-listview-web-part ...
1
vote
3answers
274 views

Is this the best way to open a dialog for a custom page?

I did some looking around and I was planning on creating the following js function to open a custom page in a dialog: //Handle the DialogCallback callback function ...
1
vote
1answer
1k views

How to check if current folder in document library has child items via JavaScript client object model?

I have a custom button on ribbon, which performs some action with current folder (download folder content as zip package). I want to disable this button in case if current folder doesn't contain any ...
1
vote
1answer
93 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) { ...
1
vote
2answers
2k 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: ...
1
vote
1answer
84 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 ...
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 ...
1
vote
1answer
548 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" ...
1
vote
1answer
347 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
1
vote
2answers
702 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 ...
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 ...
1
vote
4answers
655 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
689 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 ...
1
vote
1answer
555 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
1answer
415 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 ...
1
vote
1answer
390 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.
1
vote
1answer
462 views

Highlight Group By Row in SharePoint List

I've got a dashboard on my SharePoint Homepage that shows a RAG status of all our project tollgates, grouped by (a) category then (b) project. Is there a way to highlight a group by row in a list ...
1
vote
1answer
464 views

SharePoint 2007 Search Webservice client call - darrenjohn's API

I want to get the same result set as sharepoint search returns using webservice/object model, what is right way of doing it? Let's say: If sharepoint search core result webpart says 20 items/result ...
1
vote
3answers
3k views

Show number of items in Folder in ListView

I'm looking for a solution that displays the number of items that are stored in a folder of a list. Maybe this can be done with javascript/jquery, but I actually don't want to reinvent the wheel. If ...
1
vote
2answers
2k views

Preventing Duplicate Items in list (sharepoint 2007)

Is it possible to restrict, creation of duplicate list item in the Sharepoint 2007, using Javascript in content editor webpart to validate when an list item is added?
1
vote
3answers
643 views

Strip publishing master-page for anonymous users

Is it ok to strip a masterpage for all SharePoint scripts and styles? We have custom CSS and all of our scripts are JQuery. Even CQWP will have custom rendering. The reason we want to do this is so ...
1
vote
2answers
1k views

Content Editor Webpart Javascript Issue

I have recently upgrade our test environment to SP 2010 (using DB detach and attach approach). And also we did not do the Visual Upgrade. We have few CEWP's which is now starting throwing JS script ...
1
vote
2answers
1k views

Security warning for JavaScript and CSS file?

I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. And I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net + JavaScript (jQuery). I met with the following ...
1
vote
0answers
13 views

Populate multiple text boxes based upon dropdown list selection in SharePoint 2013 on prem

I have 1 main list called OnCallEscalationContacts. This list has fields such as - TechnologyTeam [dropdown], FirstContact [people picker], FirstContactPhone [text field], SecondContact [people ...
1
vote
1answer
17 views

To ScriptLink or not to ScriptLink

I need a custom ribbon button that calls a function in a js file in one particular library. To get access to the JS file, I could: Add the JS file reference via a content editor web part on the ...
1
vote
1answer
32 views

import sharepoint 2010 list data in json format using javascript (IE8)

i have a sharepoint list already created and populated from an excel file. How would i go about pulling data from sharepoint to a json object in my javascript program. Another requirement is that ...
1
vote
0answers
31 views

Hide weekend in calendar SharePoint 2013

I need to hide weekend in calendar SharePoint 2013. And I can hide the columns Saturday and Sunday. But I have some problems in my calendar view. The button "Add" disappears in the columns Friday. I ...
1
vote
0answers
16 views

Sharepoint 2013 Notifications (Similar to Outlook)

I have a SharePoint 2013 on-premise intranet portal. I want to build a Notifications feature similar to the one in Office 365 or something similar. Anyone got recommendations on using 3rd libraries ...
1
vote
1answer
21 views

ResetRoleInheritance problem

Im trying to reset a list's inheritance using javascript and Sharepoint 2010. Here is my code so far: <script language="JavaScript"> <!-- var vcms_currentCTX; var vcms_currentWEB; var ...
1
vote
2answers
43 views

SP2013 javascript client object model - get server time

My client machine and server machine has time offset of 2:30 hours. So when I try to retrieve Date/Time field using JSOM, it gives time according to offset. oListItem.get_item("Modified"); So how ...
1
vote
0answers
26 views

SharePoint 2013 set “Structural Navigation: Display only the navigation items below the current site” JavaScript

As the title says, I currently have JavaScript that sets the navigation, however it currently sets it too "Structural Navigation: Display the current site, the navigation items below the current site, ...
1
vote
0answers
27 views

SharePoint 2013 Search Center - Alternative for $includeLanguageScript?

Is there an alternative approach to loading the language resource files with $includeLanguageScript in SharePoint 2013 Search Center? Sometimes it happens that the file is not loaded fast enough, ...
1
vote
0answers
21 views

Change permission of the multiple items

I'm trying to conditionally change permission of the multiple items in SharePoint 2010 Forms Library. I've found the working code in MSDN ...
1
vote
0answers
36 views

JQuery does not work anymore when refresh the page SharePoint 2013

I want to change value of span by jquery (selecting by ID and CSS). The script works, but when I refresh the page, it does not work anymore. I want to change the value 0 which CSS is ...
1
vote
1answer
46 views

Javascript Object Model SharePoint 2010 Item Level Permissions With Group

I have been trying for some time now to do something that should be simple using JAVASCRIPT CSOM in SharePoint 2010. I have working code that can break list item permission and add a user to an item ...
1
vote
1answer
34 views

Get Field order from a list view : Javascript object model

I am getting the fields of a list view using the javascript object model view.get_viewFields() However, this does not return the fields in order which they are configured in the view. It just ...
1
vote
0answers
15 views

Add action on approve button

I want to trigger a custom javascript code when I click on the Approve button on an Approve form (during an Approval workflow). How can I do that?
1
vote
1answer
39 views

Need insight on UpdatePanel / _DoPostBack with JavaScipt

I've spent the better part of three days trying to wrap my head around UpdatePanel and _DoPostBack to find a solution to my problem with my infopath browser enabled form. I have a simple script that ...
1
vote
1answer
28 views

Sharepoint Hosted App Unable To Add Groups

I'm writing a SharePoint hosted app that allows the user to create groups and assign users to them. However, every time I run the code, it gives me a Permission Denied message, saying I don't have the ...
1
vote
0answers
76 views

Image file corrupted upon upload via REST

I have been attempting to use REST to upload image files to SharePoint but am running into the same issue again and again. The issue is that while the image file uploads to an image library, it shows ...
1
vote
0answers
24 views

Access ADFS-provided information in CSOM

I have hit a bit of a roadblock in some recent work, and I'm not sure how to proceed. Goal: be able to access a user's first and last name in JavaScript running in a SharePoint 2013 page, through the ...
1
vote
2answers
40 views

Is There A Way to Determine if More Than One Option in Custom Dropdown Field?

I have a custom dropdown choice field that is created using jQuery after a date is selected and a choice box is selected as "Yes." Here is that function: function queryEvents(date){ ...
1
vote
1answer
39 views

App Part : javascript library loaded only after clearing the cache

I've created a provider hosted-app for SharePoint and I've added a Web Part into the App to be able to view my app from the SharePoint host web. In the app web of the project, I've included various ...
1
vote
0answers
8 views

Determine when a boolean function has changed from true to false [closed]

I have a Print button on a web page that opens a PDF in a new window. I have function, lets call it pWindowNeeded this holds a boolean value. function pWindowNeeded() { if ( newPWindowNeeded == 'Y') ...
1
vote
1answer
175 views

Get value from textboxes inside dynamic table using selector

I am creating one row every time im clicking on the btn Add row. In this row there is 3 textboxes and one lable(span) and one buttom. I want to reach by selector the value in the (input type:text) or ...
1
vote
1answer
35 views

How to fetch highest value item from SharePoint list

I created a Custom List in developer Site. In that List I created a column called Totalsumma and added some numeric items like "324", "567" etc. How can I fetch the highest value from that column. ...
1
vote
1answer
51 views

Approve Permission to list item in SharePoint 2013

I have to set approve permission using JavaScript client object model. I have used below code to set other permission. But for Approve it is not working. function ...
1
vote
1answer
23 views

Increase reponse size limit in sharepoint cross-domain library

As mentioned here, the response-size expected shouldn't be more than 200 kb when using the cross-domain library with web proxy. Is it possible to increase this limit? I am trying to build a ...
1
vote
0answers
50 views

Javascript won't work in Chrome

I've a problem with my SharePoint-Javascript. In IE and FF it works propably fine, but in Chrome it won't work. The script is called on a refresh of the main page and auto adds some users in a ...
1
vote
2answers
62 views

jquery.done runs before when - deferred promise

I have placed a SEWP in an editform and the code is supposed to do the following: check if the logged in user is site administrator and web administrator - if not then hide a specific field. These two ...