"Richard Cornford" <
[email protected]> a écrit dans le message de
[email protected]...
| Jean Pierre Daviau wrote:
| > My second post with the question dissapeared somewhere.
|
| Try putting the question in the same post as the code.
|
| > I am posting with OutlookExpress. Is there a problem with
| > that on the newsgroup server?
|
| Outlook express can be successfully used for posting to newsgroups,
| though it probably takes more effort on the part of its users to get the
| posting format correct than some of the alternatives.
|
| > J. J. Cale wrote:
| >| var n = document.images.length;
| >| I suspect this typo has been persisting since the original
| >| post
| >
| > If I write alert(document.images[0].width+document.images[1].width)
| > it gives 271 . Witch is OK.
| >
| > If I use a for loop, I get 0. Why ?
|
| The point that J.J.Cale is making is that "lenght" is a misspelling of
| "length" and as the form will not have a "lenght" property the - n -
| variable will be assigned the value - undefined -. Then when - i < n -
| is evaluated (where - i - is numeric) - n - will be type-converted to a
| number, and that number is NaN. All comparisons with NaN return false so
| the body of the - for - loop is never executed and the - totalWidth -
| and - totalHeight - variables retain the value to which they were
| initialised; zero.
|
| On the whole the scheme seems potty though. There is no useful
| relationship between the screen.availWidth/Height values and anything
| that happens within the viewport of a web browser (not even that the
| dimensions of the viewport will be less than the avialWidth/Height).
|
| Richard.
Thank you very much