IxxI
02-06-2003, 10:44 AM
I am currently using this javascript call as the mouse passes over a button to show some text in a div box in a different frame:
var setup = "Do this do that etc."
function showbox() {
if(window.top.iframe.main.document.getElementById("mainbox")){
window.top.iframe.main.document.getElementById("mainbox").style.visibility = "visible";
window.top.iframe.main.document.getElementById("mainbox").innerHTML = setup;
}
else{}
}
Problem is I have one of these for each button so the code is quite long, and I was wondering if there was any way to use the eval command to have one javascript call with mulltiple variables as opposed to multiple javascript calls. My code works fine - its just an aesthetic thing. I've tried changing my code to:
function showbox(text) {
if(window.top.iframe.main.document.getElementById("mainbox")){
window.top.iframe.main.document.getElementById("mainbox").style.visibility = "visible";
window.top.iframe.main.document.getElementById("mainbox").innerHTML.value = eval(text);
etc.
and writing onMouseover="showbox('setup')" into my link, but it doesn't seem to work. Any suggestions?
IxxI
var setup = "Do this do that etc."
function showbox() {
if(window.top.iframe.main.document.getElementById("mainbox")){
window.top.iframe.main.document.getElementById("mainbox").style.visibility = "visible";
window.top.iframe.main.document.getElementById("mainbox").innerHTML = setup;
}
else{}
}
Problem is I have one of these for each button so the code is quite long, and I was wondering if there was any way to use the eval command to have one javascript call with mulltiple variables as opposed to multiple javascript calls. My code works fine - its just an aesthetic thing. I've tried changing my code to:
function showbox(text) {
if(window.top.iframe.main.document.getElementById("mainbox")){
window.top.iframe.main.document.getElementById("mainbox").style.visibility = "visible";
window.top.iframe.main.document.getElementById("mainbox").innerHTML.value = eval(text);
etc.
and writing onMouseover="showbox('setup')" into my link, but it doesn't seem to work. Any suggestions?
IxxI