Reply to Re: multiple frame-update

Your name:

Reply:


Posted by Safalra on 11/22/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/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация