User Profile

Collapse

Profile Sidebar

Collapse
si4
si4
Last Activity: Nov 26 '07, 01:18 PM
Joined: Aug 17 '07
Location: Sofia, Bulgaria
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • si4
    replied to setTimeout() recursion problem
    OK. Thanks a lot for the help.

    I've though to use setInterval(), but I wanted to understand why this brakes.

    Thank you again for the explanation!
    See more | Go to post

    Leave a comment:


  • Hi,

    Here is nice article about variable scope in Javascript:
    http://www.thescripts.com/forum/thread655478.html

    Check your IFs statements, because if they are not TRUE neither of all loops you will not set the array any value.

    ( Sorry for the bad English )...
    See more | Go to post

    Leave a comment:


  • When you call c, you print the whole array at once.
    You need to walk through the elements with loop one by one.

    Here sample code:
    [CODE=javascript]
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <script type="text/javascript">
    c = new Array( "Apple",...
    See more | Go to post

    Leave a comment:


  • si4
    replied to setTimeout() recursion problem
    May be there is problem with line breaks, because file is created with gnu/linux editor and some windows editors show it as one line.

    This is the code in the js file:

    [CODE=javascript]function cDestroyer( node, it ){
    if( !node){ var node = document.body }

    var stuffToDestroy = node.childNodes ;

    if( it ){ it = parseInt(it);}
    if( !it ) { it= stuffToDestroy. length - 1;}// we...
    See more | Go to post

    Leave a comment:


  • si4
    started a topic setTimeout() recursion problem

    setTimeout() recursion problem

    Hello,

    I'm currently studying javascript by myself.
    I thought that I will write js that will remove element in the body from DOM every 2 seconds, untill all elements in the body are deleted( except debug <span> :) )

    At first I tried to go through the elements with loop, but when I call setTimeout() the loop doesn't wait setTimeout() to end, but it continues looping.

    Now I use recursion. setTimeout()...
    See more | Go to post
No activity results to display
Show More
Working...