This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WCF RESTful services and JavaScript Consumers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//We need to run our function only after sp.js file loads | |
ExecuteOrDelayUntilScriptLoaded(ViewItem, "sp.js"); | |
function ViewItem() | |
{ | |
var context = new SP.ClientContext.get_current(); | |
var web = context.get_web(); | |
var list = web.get_lists().getByTitle('<<List Name>>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
28 type: "GET", | |
29 url: "EDS/Company.xml", | |
30 dataType: "xml", | |
31 success: function (xml) { | |
32 | |
33 var select = $('#companyDDL'); | |
34 | |
35 $(xml).find('Company').each(function () { | |
36 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var directionsDisplay; | |
var directionsService = new google.maps.DirectionsService(); | |
var map; | |
function initialize() { | |
directionsDisplay = new google.maps.DirectionsRenderer(); | |
var sa = new google.maps.LatLng(29.578306, -98.440629); | |
var mapOptions = { | |
zoom: 7, | |
center: sa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Needed By Date Validation | |
var today = new Date(); | |
today.setHours(0, 0, 0, 0); | |
var fourDaysFromNow = new Date(); | |
fourDaysFromNow = calcBusinessDays(new Date(), 4); | |
if (screen.PurchaseRequisition.NeedByDate.toString() == today.toString()) { | |
alert("You’ve selected today as the delivery date. That may not be a realistic delivery date. Do you want to change the delivery date?\n\nThis delivery date may not be possible. Expediting charges will be applied to the order and billed to your department."); | |
} | |
else if (screen.PurchaseRequisition.NeedByDate < fourDaysFromNow) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var funcName = "myfunc"; | |
var thingy = {age:27, | |
myfunc: function fun() { | |
console.log("It worked") | |
}}; | |
thingy[funcName](); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slug (text) { | |
var separator = /[^a-z0-9]+/ig; | |
var drop = /^-|-$/g; | |
return text | |
.replace(separator, '-') | |
.replace(drop, '') | |
.toLowerCase(); | |
} | |
function stamp(date){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Created by Joel Palmer on 7/3/2015. | |
ES6 --- FireFox 32+ only as of Created by date | |
Doc & Polyfill: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from | |
*/ | |
//create an array from function arguments | |
var args = function(){ | |
return Array.from(arguments); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Joel Palmer on 7/6/2015. | |
* | |
* ES6 - FF only as of now | |
* | |
* Polyfill: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find | |
*/ | |
function isEven(el, idx, array){ | |
return el % 2 == 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//target (our payment object interface) | |
interface IPayment { | |
id: string; | |
total: number; | |
SubmitPayment: Function; | |
} | |
//our payment class | |
class Payment implements IPayment { | |
public id: string; | |
public total: number; |
OlderNewer