text: Q:
  
  How to get myTasks from mySite?
  
  Hello i try to get myTasks for the current User from sharepoint 2013. I tried it with the Rest-API and with JSON but i always get an error. Acording to the debugger ExecuteOrDelayUntilScriptLoaded is undefined.
  Here is my little Javascript i got so far: (old)
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" src="/_layouts/15/MicrosoftAjax.js"></script>
  <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
  <script type="text/javascript" src="/_layouts/15/sp.js"></script>
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.0/jquery-ui.min.js"></script>
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js"></script>
  <script type="text/javascript" src="/sps10/EDV/jquery.js"></script>
  
  <script type="text/javascript">
  
  var context, userSessionManager ,userSession , query , myTasks ;
  $(document).ready(function () {
     ExecuteOrDelayUntilScriptLoaded(function () {
         context = SP.ClientContext.get_current();
         ExecuteOrDelayUntilScriptLoaded(function () {
             userSessionManager = new SP.WorkManagement.OM.UserOrderedSessionManager(context);
             userSession = userSessionManager.createSession();
             query = new SP.WorkManagement.OM.TaskQuery(context);
             myTasks = userSession.readTasks(query);
         }, "sp.workmanagement.js");
         getMyTasks();
     }, "sp.js");
  });
  
  function getMyTasks() {
      context.load(myTasks);
      context.executeQueryAsync(onGetMyTasksSuccess, onGetMyTasksFail);
  }
  
  // This function is executed if the above call is successful
  function onGetMyTasksSuccess() {
      console.log("Successfully retrieved tasks...");
      var taskEnumerator = myTasks.getEnumerator();
      while (taskEnumerator.moveNext()) {
          var task = taskEnumerator.current;
          console.log("Task: " + task.get_id() + " - " + task.get_name());
      }
  }
  
  // This function is executed if the above call fails
  function onGetMyTasksFail(sender, args) {
      console.log('Failed to get tasks. Error:' + args.get_message());
  }
  
  </script>
  
  Edit 1: Here is the new Version of my Code:
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.min.js"></script>
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.0/jquery-ui.min.js"></script>
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js"></script>
  <script type="text/javascript" src="/sps10/EDV/jquery.js"></script>
  
  <script>
  
      var context, userSessionManager, userSession, query, myTasks;
      $(document).ready(function () {
          var scriptbase = "https://www.example.at/_layouts/15/"
          $.getScript(scriptbase + "sp.runtime.js", function () {
              $.getScript(scriptbase + "sp.js", function () {
                  $.getScript(scriptbase + "sp.workmanagement.js", test)
              });
          });
      });
  
      function test() {
  
          context = SP.ClientContext.get_current();
  
          userSessionManager = new SP.WorkManagement.OM.UserOrderedSessionManager(context);
          userSession = userSessionManager.createSession();
          query = new SP.WorkManagement.OM.TaskQuery(context);
          myTasks = userSession.readTasks(query);
  
          getMyTasks();
  
      }
  
      function getMyTasks() {
          context.load(myTasks);
          context.executeQueryAsync(onGetMyTasksSuccess, onGetMyTasksFail);
      }
  
      // This function is executed if the above call is successful
      function onGetMyTasksSuccess() {
          console.log("Successfully retrieved tasks...");
          alert("fudhokn");
          var taskEnumerator = myTasks.getEnumerator();
          while (taskEnumerator.moveNext()) {
              var task = taskEnumerator.current;
              console.log("Task: " + task.get_id() + " - " + task.get_name());
          }
      }
  
      // This function is executed if the above call fails
      function onGetMyTasksFail(sender, args) {
          console.log('Failed to get tasks. Error:' + args.get_message());
      }
  
  </script>
  
  So any help or advise would be great. If you want i can post my Code with the rest-api too but the error stays the same.
  Thanks for your help and time.
  Edit 2: Working solution to query my Task with a plain html: The important things are to load the scr in the right order and to use the jquery-min and not the normal jquery.
  <script src="/_layouts/15/init.js" type="text/javascript"></script>
  <script src="/_layouts/15/MicrosoftAjax.js" type="text/javascript"></script>
  <script src="/_layouts/15/sp.core.js" type="text/javascript"></script>
  <script src="/_layouts/15/sp.runtime.js" type="text/javascript"></script>
  <script src="/_layouts/15/sp.js" type="text/javascript"></script>
  <script src="/_layouts/15/sp.workmanagement.js" type="text/javascript"></script>
  <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js" type="text/javascript"></script>
  
  <script type="text/javascript">
  
      'use strict';
  
      var context = new SP.ClientContext.get_current();
      var userSessionManager = new SP.WorkManagement.OM.UserOrderedSessionManager(context);
      var userSession = userSessionManager.createSession();
      var query = new SP.WorkManagement.OM.TaskQuery(context);
      var myTasks = userSession.readTasks(query);
  
          getMyTasks();
  
      function getMyTasks() {
          context.load(myTasks);
          context.executeQueryAsync(onGetMyTasksSuccess, onGetMyTasksFail);
      }
  
      // This function is executed if the above call is successful
      function onGetMyTasksSuccess() {
          console.log("Successfully retrieved tasks...");
          var taskEnumerator = myTasks.getEnumerator();
          while (taskEnumerator.moveNext()) {
              var task = taskEnumerator.current;
              console.log("Task: " + task.get_id() + " - " + task.get_name());
          }
      }
  
      // This function is executed if the above call fails
      function onGetMyTasksFail(sender, args) {
          console.log('Failed to get tasks. Error:' + args.get_message());
      }
  
  </script>
  
  For the aspx version refer to the answer below.
  
  A:
  
  This solution works fine in ASPX page not sure about HTML page.
  Microsoft did some changes in the ExecuteOrDelayUntilScriptLoaded method in SharePoint 2013 and renamed it to be `executeFunc.
  Example:
  SharePoint 2013 Code:
  <script type="text/javascript">
  
  var context, userSessionManager ,userSession , query , myTasks ;
  $(document).ready(function () {
     SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
         context = SP.ClientContext.get_current();
         ExecuteOrDelayUntilScriptLoaded(function () {
             userSessionManager = new SP.WorkManagement.OM.UserOrderedSessionManager(context);
             userSession = userSessionManager.createSession();
             query = new SP.WorkManagement.OM.TaskQuery(context);
             myTasks = userSession.readTasks(query);
         }, "sp.workmanagement.js");
         getMyTasks();
     });
  });
  
  function getMyTasks() {
      context.load(myTasks);
      context.executeQueryAsync(onGetMyTasksSuccess, onGetMyTasksFail);
  }
  
  // This function is executed if the above call is successful
  function onGetMyTasksSuccess() {
      console.log("Successfully retrieved tasks...");
      var taskEnumerator = myTasks.getEnumerator();
      while (taskEnumerator.moveNext()) {
          var task = taskEnumerator.current;
          console.log("Task: " + task.get_id() + " - " + task.get_name());
      }
  }
  
  // This function is executed if the above call fails
  function onGetMyTasksFail(sender, args) {
      console.log('Failed to get tasks. Error:' + args.get_message());
  }
  
  </script>
  
  Reference
  SP.ClientContext object (sp.js)
  Update all JS references with below code in your page.
  <SharePoint:ScriptLink ID="scriptLink1" runat="server" Name="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.min.js" LoadAfterUI="true" OnDemand="false" />
  <SharePoint:ScriptLink ID="scriptLink2" runat="server" Name="/_layouts/15/MicrosoftAjax.js" LoadAfterUI="true" OnDemand="false" />
  <SharePoint:ScriptLink ID="scriptLink3" runat="server" Name="/_layouts/15/sp.runtime.js" LoadAfterUI="true" OnDemand="false" />
  <SharePoint:ScriptLink ID="scriptLink4" runat="server" Name="/_layouts/15/sp.js" LoadAfterUI="true" OnDemand="false" />
  <SharePoint:ScriptLink ID="scriptLink5" runat="server" Name="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.0/jquery-ui.min.js" LoadAfterUI="true" OnDemand="false" />
  <SharePoint:ScriptLink ID="scriptLink6" runat="server" Name="https://ajax.aspnetcdn.com/ajax/knockout/knockout-2.1.0.js" LoadAfterUI="true" OnDemand="false" />
  <SharePoint:ScriptLink ID="scriptLink7" runat="server" Name="/sps10/EDV/jquery.js" LoadAfterUI="true" OnDemand="false" />
  
  Note:-
  Kindly download external JS files, place them to some folder (Layouts) & replace the reference in above code with that new location.
  
  