0

Hi I am new to electron so i don't know how to do this simple thing... also tried searching before asking but was not able to find proper solution.

// HEADER
<!DOCTYPE html>
<html>
<head>
    // some css files
</head>
<body>
// END HEADER


// INDEX.HTML
<div class="wrapper"></div>
// END INDEX.HTML


// FOOTER
    // some scripts using require and script taglike 
   require('renderer.js');
</body>
</html>
// END FOOTER

These are three parts of my file header, main content, footer ... I want to keep header and footer in different files so that i can include them in other files too so that all the pages can get same header and footer.
In php I used to do include("header.php"); Something Like this I want to do in Electron


I Want to include header.html and footer.html in index.html file
Please try to give the easiest solution

Neeraj Walia
  • 208
  • 3
  • 16
  • Electron is basically a browser window; what you are trying to do requires a server though. I'd advise to use a JS framework like React or Angular instead. –  Aug 26 '18 at 20:14
  • You don't need a framework for that, all you need is a templating engine like handlebars. They are easy to get started with. – dunno Aug 26 '18 at 20:56
  • Have you seen: https://stackoverflow.com/q/8988855/6577664? – Joshua Aug 27 '18 at 16:48
  • @Mike They are loading external file into a div ... but how can i load full header.html file which includes css and all into div... I think it is not possible – Neeraj Walia Aug 27 '18 at 17:57
  • @ChrisG Thanks But I only know jquery ... No react no angular – Neeraj Walia Aug 27 '18 at 17:58

0 Answers0