View Single Post
  #2 (permalink)  
Old 01-09-09, 08:57 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
Remove the equal sign in this line:
Code:
for(i=0;i<=aantal;i++)
... it makes the loop run one time too much, hence you get the error.

EDIT:

And this line:
Code:
window.onload = pi();
.... should be:
Code:
window.onload = pi;
... with the parenthesis, you're calling the function. And if it's being called before the browser has parsed the full page, it's possible that you get this error too.

Last edited by Nico; 01-09-09 at 09:01 AM.
Reply With Quote