Im using the .load() Jquery function, to include html tags inside another html file.
code example:
a.html:
<html>
<head>
<script src="jquery.js"></script>
<script>
function loadContent()
{
$("#includedContent").load("b.html");
}
</script>
</head>
<body>
<div id="includedContent"></div>
<script>loadContent()</script>
</body>
b.html:
<!--Include it-->
<p> This is my include file </p>
When i’m open a.html in my browser and click “view source” i can NOT see
<!--Include it-->
why is that?
I need it for tracing stuff.
If you make a simple html file:
<html>
<body>
<!-- Hello -->
<p>Hello world </p>
</body>
</html>
Open it in a browser, click “view source”. you CAN see
<!-- Hello -->
Why when we using .load() we can not see the comment???
.load() Jquery function its a good and helpful way to include *.html files. But for this problem it dose not so helpful because the solution need to involve “view source” functionality to can be seen the comments there.
What can be done?
SSI (server side include) solution, that need to be configured by the administrator.
file .htaccess need to be configured to enabled apache to handled *.shtml files.
information about SSI can be found in the web.