I'm trying to add a jQueryt block to oslo master page on spo 2013. check out, make changes and save, but no apparent impact. Am I placing javascript in the wrong place? do I need to do any additional steps. I'm using spd 2013.
Basically I want to add some code to keep all users except those with full control out of all pages except the site pages. Possible? if anybody is doing anything like this please share.
I'm placing this code right above the (/SharePoint:SharePointForm) tag close at the tail end of the master page
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
<script>
alert("wtf");
$(document).ready(function () {
var currentUser;
// Ensure that the SP.js is loaded
if (SP.ClientContext != null) {
SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');
}
else {
SP.SOD.executeFunc('sp.js', null, getCurrentUser);
}
function getCurrentUser() {
var context = new SP.ClientContext.get_current();
var web = context.get_web();
currentUser = web.get_currentUser();
context.load(currentUser);
context.executeQueryAsync(onSuccessMethod, onRequestFail);
}
function onSuccessMethod(sender, args) {
var account = currentUser.get_loginName();
var currentUserAccount = account.substring(account.indexOf("|") + 1);
alert(currentUserAccount);
}
// This function runs if the executeQueryAsync call fails.
function onRequestFail(sender, args) {
alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
}
});
</script>