Problems with Loading html Pages Using script Tags

  node.js, question

Page a:

clipboard.png

Page b:

clipboard.png

I am now using it on page A.
<script src="js/table.html" type="text/html" id="demo"></script>
After reference, the debugging tool can display the contents

clipboard.png

But how do you take it out? What is the problem?

The purpose of doing this is to write a template engine myself. AlthoughWriting a Simple JavaScript Template Engine-Liao XuefengThis article is very useful, but one thing I don’t understand is, does the template inside’s page have to be placed on the page inside? Can’t it be placed on a single page and quoted by inside?

Many tutorials are written in this way.

clipboard.png

But I want to put this piece:

clipboard.png

Can’t you put it on a single page? Or is there something wrong with the way I used it? Solving.

Html content can be obtained by text request through ajax.