0

I want to make a popup for index.html page. I have a demo, a popup will appear at bottom-right of webpage. But my demo was wrote by jsp, not html.

<jsp:include page="popup.html" flush="true" ></jsp:include>

It work ok.

But in html, this line not work. I have tried:

<!--#include virtual="popup.html" -->
<!--#include file="popup.html" -->

but no popup appear.

So, Are there anyways to include popup.html. Thanks you!

Tiang
  • 57
  • 1
  • 11
  • Only through XHR, but it will entail an extra HTTP request. – Alex Pakka Mar 28 '12 at 03:27
  • Probable duplicate of http://stackoverflow.com/questions/676394/how-to-include-an-html-page-into-an-html-page - look at [this answer](http://stackoverflow.com/a/676409/983430) to see how to do it with jQuery. – Amos M. Carpenter Mar 28 '12 at 03:50

1 Answers1

2

To use <!--#include, you need to make sure that your web server has Server Side Includes enabled.

You could also use a server-based language like PHP which will do this using functions like readfile().

In pure HTML, I suspect your only option would be to include the second HTML file inside an <iframe>. It's by no means an ideal solution, but if nothing else works, this may.

ghoti
  • 45,319
  • 8
  • 65
  • 104