Skip to content

Instantly share code, notes, and snippets.

View tristian2's full-sized avatar
🎯
Focusing on final MSc Data visualisation assignment and SharePoint migration

tristian o'brien tristian2

🎯
Focusing on final MSc Data visualisation assignment and SharePoint migration
View GitHub Profile
@tristian2
tristian2 / selectors.js
Created January 12, 2016 15:31
JQuery selectors
//just for the console
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict()
//just for the console END
jQuery(document).ready(function() {
@tristian2
tristian2 / CRUDLists
Created January 12, 2016 14:09
CRUD SharePoint List REST Methods
//just for the console
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict()
//just for the console END
var listurl = "http://sharepointsupport/smallsys/testscr/Lists/TestKnockoutCRUD/AllItems.aspx";
@tristian2
tristian2 / An-Anonymous-Pen.markdown
Created November 21, 2013 16:33
A Pen by Anonasaurus Rex.
@tristian2
tristian2 / A-Pen-by-tristian-obrien.markdown
Created November 21, 2013 16:34
A Pen by tristian o'brien.

jQuery.ajax.fake

when you want to fake an ajax call, that's because your server's web service is just not ready yet, and whenever that web service is ready, switching back to it should cost nothing..

with jquery.ajax.fake you simply write pure jQuery ajax call, with only one extra property fake: true

How to use it

include jquery.ajax.fake.js script into your markup, and create webservices.fake.js to handle fake ajax calls

<script src="jquery.ajax.fake.js"></script>
@tristian2
tristian2 / SharePointSitesListsandFieldsReportUsingREST.txt
Last active November 4, 2015 09:00
SharePointSitesListsandFieldsReportUsingREST
<!--place code in a script editor webpart, or use as the basis of custom JavaScript etc.
returns all Webs on a given url and child lists
to return both domains, duplicate the code, but need to configure CORS on your webservers
this version carries out three depenedent rest calls to get the webs, their lists and then the url of the list - this is a "feature" of working with restful SHarePoint
intent tion is to bundle this into a webpart - then solution-->
<script type="text/javascript">
ACME.SupportSite.Utilities.WebListsReport = function (divToPlaceReport) {
var webs = [];
var lists = [];