|
Posted by Safalra on 11/11/09 11:31
Jonathan N. Little wrote:
> ark312 wrote:
> > 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?
> > [snip]
> > <a href="Mirte.htm"
> > target="Info"
> > onclick="if (parent.frames.Play) {
> > parent.frames.Play.location.href = 'PlayMirte.htm';
> > }
> > and
> ^^^
> JavaScript does not have logical operator 'and', it is '&&', i.e.,
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 =
'PlayMirte.htm';
if (parent.frames.Text) parent.frames.Text.location.href =
'Text0000.htm';
return true;
--
Safalra (Stephen Morley)
http://www.safalra.com/programming/javascript/
Navigation:
[Reply to this message]
|