Provisioning with JavaScript

First See this Post: For ProvisioningResourceApp Visual Studio Solution that Created Step By Step

http://tabrezblog.azurewebsites.net/post/2017/05/03/provisioning-resources-to-appweb-using-caml

Open App.JS, delete all previous code of this file.

Add following code:

(function () {
var appURL = GetUrlKeyValue("SPAppWebUrl");

jQuery(function () {
var message = jQuery("#message");
});

function failHandler(jqXHR, testStatus, errorThrown) {
var response = "";
try {
var parsed = JSON.parse(jqXHR.responseText);
response = parsed.error.message.value;
} catch (e) {
response = jqXHR.responseText;
}
alert("Call failed. Error: " + response);
}
})();

Now i am going to use a little trick here, I am going to use the Repository js file of Pluralsight, I am very thankful to Rob Windsor for this:

repositories.js (7.54 kb)

Add this js file under Script Folder in your solution:

Add repositories.js file to _references.js for get intellisense :

Add this js file also on the default.aspx page:

Save your project.

Deploy this SharePoint Hosted App and Enjoy.......

 

Add comment