www.webdeveloper.com
Results 1 to 3 of 3

Thread: Refresh problem

  1. #1
    Join Date
    Mar 2013
    Posts
    61

    Refresh problem

    I'm designing an app that uses an element that refreshes the page. The problem is that when the webpage loads I use a for loop to create all the elements. Because of this element that refreshes the page, every time it does it calls the for loop again. This causes problems as you can imagine. Any idea how I can stop this? I'm tempted to set a boolean but if there is another way I will take it.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,655
    add a condition into the loop to check if element already exists before creating it

  3. #3
    Join Date
    Mar 2013
    Posts
    61
    Quote Originally Posted by Padonak View Post
    add a condition into the loop to check if element already exists before creating it
    Thanks. Just gave that ago and got an offsetWidth error.

    I tried this line to trigger before the loop.

    Code:
    if(document.getElementById("googleMap") == null)
    The problem I think involved this line.

    Code:
    google.maps.event.addDomListener(window, 'load', getLocation);
    This function then calls all the other functions connected to load. any thoughts?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles