so, i'm learning to integrate php and sql. but in the meantime, i came across a page discussing changing content with innerhtml.
they use:
<script type="text/javascript">
/*************************************************************************
This code is from Dynamic Web Coding at [url]http://www.dyn-web.com/[/url]
See Terms of Use at [url]http://www.dyn-web.com/bus/terms.html[/url]
Permission granted to use this code
as long as this entire notice is included.
*************************************************************************/
function changeContent(id,shtml) {
if (document.getElementById || document.all) {
var el = document.getElementById? document.getElementById(id): document.all[id];
if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
}
}
var msg1 = 'New content for the layer. Content written to the element can be plain text or <span class="hot">rich html,</span> including images.';
var msg2 = "You can enclose your message string in single quotes so html tags in the string can use double quotes for attributes.";
var msg3 = 'There are lots of writing to layers examples at <a href="http://www.dyn-web.com">[url]www.dyn-web.com[/url]</a>.';
</script>
with a link call via:
<p><a href="javascript:;" onmouseover="changeContent('lyr1', msg1)" onmouseout="changeContent('lyr1','A layer you can write to.')">Hover here</a> to change the content of the layer above. <a href="javascript:;" onclick="changeContent('lyr1',msg2)">Click here</a>.</p>
to a div:
<div id="lyr1">Layer you can write to onmouseover or onclick.</div>
i tried to make the msg1 variable:
var msg1 = "<?php include ('includes/day.inc');?>"
to replace this content:
<div id="lyr1">
<?php include('includes/lengths-menu.inc');?>
</div>
but it won't work. is there something special i have to do to make it recognize the include?
thank you!