title: How call a javascript function from another javascript file
body: <p>I have a main html file called default.html with two javascript files default.js and backend.js.</p>
  <p>The two javascript files are added as follow in the main html</p>
  <pre><code>&lt;script src=&quot;assets/js/backend.js&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;assets/js/default.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>the default.js contains this setup</p>
  <pre><code> startUp()
    
  eel.expose(startUp);
  function startUp(){
      
   showNextPage() // this work and shows the next page
      
  }
  
  function showNextPage(){
  
   console.log(&quot;show next page&quot;)
    window.location = 'next.html'
  }
  </code></pre>
  <p>I then tried to call default.js function showNextPage() from backend.js, it only shows the console.log message but does not change the page.</p>
  <p>everything works fine when i call showNextPage within default.js. I've tried many methods but it all seem like it's not allowing me to change the page from backend.js.
  How can I fix this and call page change from backend.js?</p>
  <p>I have tried
  window.location.href = &quot;next.html&quot;</p>
  <p>window.location.replace = (&quot;next.html&quot;)</p>
  <p>and other variations. For reason unknown, everything works except changing of pages from backend.js</p>