Question

I have the following code:

<script>
   var load = function load_home(){
    document.getElementById("content").innerHTML='<object type="type/html" data="/linker/templates/button.html" ></object>';
   }
</script>
<div id="content"></div>

But it does not load anything, also console does not display any errors. This is inside a sails.js app

Was it helpful?

Solution

you are not calling load function, call it when your window loads,

<script>
   var load = function load_home(){
    document.getElementById("content").innerHTML='<object type="type/html" data="/linker/templates/button.html" ></object>';
   }
   window.onload=function(){
      load();
  }
</script>
<div id="content"></div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top