title: How to call one function inside another function Jquery
body: <p>I have one save button by clicking this button it should do to functionalities like converting to canvas and need to be download the image. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>     $(document).ready(function(){ 
              var element = $("#bgcolor"); // global variable
              var getCanvas; // global variable
               
                  $("#save_btn").on('click', function () {
                       html2canvas(element, {
                       onrendered: function (canvas) {
                              getCanvas = canvas;
                           }
                       });
                  });
              
               $("#save_btne").on('click', function () {
                  var imgageData = getCanvas.toDataURL("image/png");
                  
                  var newData = imgageData.replace(/^data:image\/png/, "data:application/octet-stream");
                  $("#save_btne").attr("download", "revbay.png").attr("href", newData);
               });         
            });
      </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;a href="#" id="save_btn"&gt;Save&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How to call this inside of the another function I tried to call but I need to be click two time on save button which is not correct, please let me know that by one click it whould perform this two functions.</p>