SharePoint - Creating a Rotating Image Banner using JavaScript
Build a rotating image banner in SharePoint 2013 by reading a picture library with REST and swapping an img tag every 5 seconds.
Tag
Build a rotating image banner in SharePoint 2013 by reading a picture library with REST and swapping an img tag every 5 seconds.
A utility function that finds a timer job by name in the current web application and returns its schedule type.
string GetTimerJobStatus(string timerJobName)
{
string schedule = string.Empty;
SPSecurity.RunWithElevatedPrivileges(() =>
{A JavaScript client object model sample that fetches a list item attachment by file name.
var clientContext = SP.ClientContext.get_current();
var list = clientContext.get_web().get_lists().getByTitle("LISTNAME");
var listItem = list.getItemById(ID);
clientContext.load(listItem);
clientContext.load(listItem.get_attachmentFiles().getByFileName("FILENAME"));
clientContext.executeQueryAsync(Function.createDelegate(this, onSuccess), Function.createDelegate(this, onFailure));Read items from a SharePoint 2013 list with the REST API and jQuery, selecting only the fields you need.
var siteUrl = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl;
jQuery.ajax({
url: siteUrl + "/_api/lists/getbytitle('ListTitle')/Items?$select=Title",
type: "GET",
headers: {Hide the page title on a SharePoint 2013 page with a small script added to the master page.
<script type="text/javascript">
function hidePageTitle() {
var elem = document.getElementById('pageTitle');
elem.style.display = 'none';
}
Override the HandleFolder function in a Script Editor web part so that folders in a document library open in a new window.
function HandleFolder(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) {
var parts = new Array();
parts = c.toLowerCase().split('%2f');
c = c.replace('SitePages/Home.aspx', parts[1]);
window.open(c);
return false;A JSOM function that looks up a managed metadata term by name in a term set and writes name|id into a hidden field.
function GetFullTermStringByName(termName, termSetId, inputId) {
var clientContext = new SP.ClientContext.get_current();
var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext);
var termStore = taxSession.getDefaultKeywordsTermStore();
var termSet = termStore.getTermSet(termSetId);
var terms = termSet.getAllTerms();Add a Download a Copy button to each row of a document library using an extra column and a Script Editor web part.
Create a search vertical for Word documents in SharePoint 2013 using a Result Source, a results page and a search settings link.
Use list validation settings and an IF formula to stop users saving items where any of three choice columns is set to None.
Use jQuery in a Script Editor web part to make list item links open the edit form instead of the display form.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
// Change all display form links to edit form links
$('.ms-vb a[href*="listform.aspx"]').each(function(){Add the missing Sign in as Different User item to the SharePoint 2013 welcome menu by editing Welcome.ascx.
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx