rpesq
06-15-2005, 06:29 PM
Hi,
I Need help changing the content of a DIV. I sincerely researched the
issue and have not found a solution except to scrap the idea and stick
with the iframe code that I had been using. My purpose here is to
avoid iframes.
I know how to change the DIV content to other basic html statements,
such as basic IMG's or Lists, but I want to put a Javascript into the
DIV, and have not found a way to do it.
The Javascript that I want to place into the DIV is a typical
tickerbox, and it is found at:
http://www.24fun.com/downloadcenter/textbgfader/textbgfader.html
I saved the code for the tickerbox to a "tickerbox.js" file.
The relevant code:
(in Head...)
<style>
.box2 {width: 408px; height: 88px;}
</style>
<script>
function jumptodiv() {
document.getElementById("area2").innerHTML = ????
}
</script>
(Body...)
<DIV id="area2" style="box2">
<img src="someintroductionphoto.jpg">
<!-- the goal is to replace this photo with the Tickerbox
Javascript when user clicks the button below -->
</div>
<form>
<input type="button" value="About" onClick="jumptodiv()">
</form>
A working solution will be sincerely appreciated. Even an example of getting ANY javascript to work when poked into the DIV would be nice.
I Need help changing the content of a DIV. I sincerely researched the
issue and have not found a solution except to scrap the idea and stick
with the iframe code that I had been using. My purpose here is to
avoid iframes.
I know how to change the DIV content to other basic html statements,
such as basic IMG's or Lists, but I want to put a Javascript into the
DIV, and have not found a way to do it.
The Javascript that I want to place into the DIV is a typical
tickerbox, and it is found at:
http://www.24fun.com/downloadcenter/textbgfader/textbgfader.html
I saved the code for the tickerbox to a "tickerbox.js" file.
The relevant code:
(in Head...)
<style>
.box2 {width: 408px; height: 88px;}
</style>
<script>
function jumptodiv() {
document.getElementById("area2").innerHTML = ????
}
</script>
(Body...)
<DIV id="area2" style="box2">
<img src="someintroductionphoto.jpg">
<!-- the goal is to replace this photo with the Tickerbox
Javascript when user clicks the button below -->
</div>
<form>
<input type="button" value="About" onClick="jumptodiv()">
</form>
A working solution will be sincerely appreciated. Even an example of getting ANY javascript to work when poked into the DIV would be nice.