michelledebeer
Programmer
I have this function that prints a text to a layer without reloading the page.
function print_text(text)
{
if(document.layers)
{
with(document.layers['myLayer'])
{
document.open();
document.write(text);
document.close();
}
}
else
{
mylayer.innerHTML=text
}
}
I would like to extend this function so that I can specify what layer the text should be added to:
<a href="print_picture('image.gif','oneLayer');">click1</a>
<a href="print_picture('image.gif','anotherLayer');">click2</a>
The function starting like this:
function print_text(text,anyLayer) { ...
Where in the function do I do this?
Any thoughts?
// Michelle
function print_text(text)
{
if(document.layers)
{
with(document.layers['myLayer'])
{
document.open();
document.write(text);
document.close();
}
}
else
{
mylayer.innerHTML=text
}
}
I would like to extend this function so that I can specify what layer the text should be added to:
<a href="print_picture('image.gif','oneLayer');">click1</a>
<a href="print_picture('image.gif','anotherLayer');">click2</a>
The function starting like this:
function print_text(text,anyLayer) { ...
Where in the function do I do this?
Any thoughts?
// Michelle