multiple frame-update

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I try to update several frames in one mouseclick. There is an error in the
code below, that is for sure. The Text-frame doesn't get updated. What do I
do wrong?



<a href="Mirte.htm"
   onclick="if (parent.frames.Play) {
                 parent.frames.Play.location.href = 'PlayMirte.htm';
           if (parent.frames.Text) {
                 parent.frames.Text.location.href = 'Text0000.htm';
               return true;">

Re: multiple frame-update

ark312 wrote:
Quoted text here. Click to load it
JavaScript does not have logical operator 'and', it is '&&', i.e.,

var result = TRUE && TRUE; //result will be TRUE.

Not like Perl, PHP and others that have 'and', 'or', 'not' for '&&',
'||' and '!'.

Quoted text here. Click to load it

Take care,

Re: multiple frame-update

Jonathan N. Little wrote:
Quoted text here. Click to load it

Correct but irrelevant - the orignal poster is using 'and' in an
attempt to get two things to happen. I suspect he/she has just been
copying and pasting Javascript without actually understanding the
language. The code should be in the following form:

if (condition1) { action1 }; if (condition2) {action 2}; return true;

And in this case as there is only one command in the action, the curly
brackets aren't needed:

if (parent.frames.Play) parent.frames.Play.location.href =
if (parent.frames.Text) parent.frames.Text.location.href =
return true;

Safalra (Stephen Morley) /

Site Timeline