Forum Moderators: open
function anything()
{
document.write('anymessage')
}
document.write(anything())
</SCRIPT>
please to explain why the output in my browser from the above script is: anymessageundefined. What does it want me to define? i tried this:
<SCRIPT type="text/javascript">
function anyword()
{
var a = document.write('anymessage')
}
document.write(a)
</SCRIPT>
and got no output whatsoever. what does me do wrong here?
<script type="text/javascript">
function anything ()
{
return 'anymessage';
}
document.write (anything ());
</script>
-------------------------------------
<script type="text/javascript">
function anything ()
{
document.write ('anymessage');
}
anything ();
</script>
It seems the problem was down to the fact that you were calling a document.write from within a document.write!
Now, apparently i can only use one return per function... is there a way around this? Some way do what i'm obviously trying to do above? I've been trying so many ways to use DIVs instead of frames, but i keep running into these silly errors that don't make sense to me...things that logically, should just WORK. using the 'visible' and 'hidden' attributes makes it such a pain to add a new page, as i need to go back then and edit every single link in the site... can anybody help me possibly write a javascript with, maybe some kind of array in which i can store all the DIVs and which basically says "if any ONE of these divs is selected, hide ALL the rest". I know this site isn't exactly to get others to do your homework for you, but... maybe a few hints? a push in the right direction? Thanks.