SHARE
TWEET

Untitled

sharepoint2020 May 3rd, 2016 (edited) 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3. function portal_openModalDialog() {
  4. var options = SP.UI.$create_DialogOptions();
  5. options.url = "/_layouts/Upload.aspx?List={327D2CF7-F385-4969-8973-E6FD3908A996}&RootFolder="; //Change the URL to the page you require.
  6. options.title = "Title of Dialog Window";
  7. options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
  8. SP.UI.ModalDialog.showModalDialog(options);
  9. }
  10. function CloseCallback(result, value) {
  11. if (result === SP.UI.DialogResult.OK) {
  12. SP.UI.Notify.addNotification("Your request has been submitted");
  13. }
  14. if (result === SP.UI.DialogResult.cancel) {
  15. SP.UI.Notify.addNotification("Request cancelled");
  16. }
  17. }
  18. </script>
  19.  
  20. <button name="button" type="button" onclick="javascript:portal_openModalDialog();javascript:return false;" href="#" target="_self">Open Link</button>
RAW Paste Data
Want to get better at JavaScript?
Learn to code JavaScript in 2017
Top