Hello all need help to call the function on page2 fundemo() based on the button click on page 1 js ABSENCE APPROVAL
Page1.html
<script>
  $.getScript(path + "js/Page1.js");
</script>
<p id="currentPage"> </p>
<div class="hr">
<input type="button" id="hr" class="appButton" value="HR" onclick="funchr();" />
<input type="button" id="crm" class="appButton" value="CRM" onclick="funccrm();"/>
</div>
 <div id="show1" style="display:none;">
 <input type="text" id="searchcustom">
 <input type="submit" id="sebutton" value="search" onclick="fus();">
 </div>
<div id="placehere">
</div>
<ul id="page1display"> </ul>
<div class="empl"> <ul id="mydemo1"> </ul> </div>
<ul id="empdetdemo"> </ul>
<input type="button" id="backButtonPage1" class="backbutton" value="BACK" onclick="currentPage.back();" />Page2.html
<script>
  $.getScript(path + "js/Page2.js");
</script>
<p id="currentPage"> </p>Page2.js
currentPage={};
currentPage.init = function() {
 WL.Logger.debug("Page2 :: init");
};
currentPage.back = function(){
 WL.Logger.debug("Page2 :: back");
 $("#pagePort").load(pagesHistory.pop());
};
function fundemo()
{
  alert("HAI");
}Page1.js
currentPage={};
currentPage.init = function() {
 WL.Logger.debug("Page1 :: init");
};
currentPage.back = function(){
 WL.Logger.debug("Page1 :: back");
 $("#pagePort").load(pagesHistory.pop());
};
function funccrm()
{
 $("#pagePort").load(path + "pages/Page3.html"); 
}
function funchr()
{   $( ".hr" ).remove();
 
    
    if(person_role == "Y")
   {
    var btn = document.createElement("BUTTON");        
    var t = document.createTextNode("ABSENCE APPROVAL");
    btn.appendChild(t);                                
    btn.setAttribute("id","absapr");
    document.body.appendChild(btn);
   }
    
    
    $('#absapr').click(function(){
       $("#pagePort").load(path + "pages/Page2.html"); 
      } 
    