Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
- <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script>
- <script type="text/javascript" src="../Scripts/CustomJS.js"></script>
- <script type="text/javascript">
- var hostweburl;
- $(document).ready(function () {
- hostweburl =
- decodeURIComponent(
- getQueryStringParameter("SPHostUrl")
- );
- var scriptbase = hostweburl + "/_layouts/15/";
- //Do not change the order, scripts should load by order.
- $.getScript(scriptbase + "init.js").done(function () {
- $.getScript(scriptbase + "sp.runtime.js").done(function () {
- $.getScript(scriptbase + "sp.js").done(function () {
- $.getScript(scriptbase + "ScriptResx.ashx?name=sp.res&culture=en-us").done(function () {
- $.getScript(scriptbase + "sp.init.js").done(function () {
- $.getScript(scriptbase + "sp.ui.dialog.js").done(function () {
- $.getStylesheet(scriptbase + '/1033/styles/corev15.css').done(function () {
- sharePointReady(hostweburl);
- })
- })
- })
- })
- })
- })
- })
- });
- (function ($) {
- $.getStylesheet = function (href) {
- var $d = $.Deferred();
- var $link = $('<link/>', {
- rel: 'stylesheet',
- type: 'text/css',
- href: href
- }).appendTo('head');
- $d.resolve($link);
- return $d.promise();
- };
- })(jQuery);
- function getQueryStringParameter(paramToRetrieve) {
- var params =
- document.URL.split("?")[1].split("&");
- var strParams = "";
- for (var i = 0; i < params.length; i = i + 1) {
- var singleParam = params[i].split("=");
- if (singleParam[0] == paramToRetrieve)
- return singleParam[1];
- }
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- </div>
- </form>
- </body>
- </html>
- function sharePointReady(hostweburl) {
- var _html = document.createElement('h1');
- _html.innerHTML = 'SharePoint Ready';
- var _options = { html: _html };
- SP.UI.ModalDialog.showModalDialog(_options);
- //fix for close button
- $('.ms-dlgCloseBtnImg').attr('src', hostweburl + '/_layouts/15/images/fgimg.png?rev=44');
- }
Add Comment
Please, Sign In to add comment