O.K. This may be a stupid question, but here goes:
I want to load an external file to supply the text for a given HTML element. I thought I could do something like:
<h1 src = "offsite.txt"></h1>
But that doesn't work. Anyone know how to do that?
O.K. This may be a stupid question, but here goes:
I want to load an external file to supply the text for a given HTML element. I thought I could do something like:
<h1 src = "offsite.txt"></h1>
But that doesn't work. Anyone know how to do that?
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
That can't be done (AFAIK) in pure html, since html is executed on the client side. You have to use asp, php or some other server-side script.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Look up SERVER SIDE INCLUSIONS.
This is one example that generally works on apache. Dont forget to make sure the SSI parser recognises your file! (Rename to .SHTM / .SHTML / .SSI or whatever your server wants)Code:<!--#include virtual="/path/to/some/text/file.txt" -->
EDIT: If you want to go PURE html, you MIGHT try the object tag, although i dont generally use them, so i cant vouch for their effectiveness.
Code:<OBJECT data="file_to_include.html"> Warning: file_to_include.html could not be included. </OBJECT>
It could be done with an inline frame... (or regular frames for that point, but those are silly)
Away.