문제

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

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top