User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,480 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,807 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

image breaking

Join Date: Aug 2007
Posts: 128
Reputation: hacker9801 is on a distinguished road 
Rep Power: 2
Solved Threads: 13
hacker9801 hacker9801 is offline Offline
Junior Poster

Re: image breaking

  #7  
Apr 2nd, 2008
Okay, so I'm parsing the map file, looping through the nodes, and adding an image based on the XML file:
  1. for(var i=0;i<map_node.childNodes.length;i++) {
  2. var node = map_node.childNodes[i];
  3. if(typeof node.tagName == "undefined") continue;
  4.  
  5. if(node.tagName == "tile") {
  6. var tile = document.createElement("IMG");
  7. tile.src = "tiles/" + node.getAttribute("type");
  8. tile.setAttribute("width", "32");
  9. tile.setAttribute("height", "32");
  10. tile.className = "brick";
  11. map.appendChild(tile);
  12. }
  13.  
  14. if(node.tagName == "br") map.appendChild(document.createElement("BR"));
  15. }
  16. }

"map" is blanked, then that code executes & adds those images.

I still see no reason for it to break.
Reply With Quote  
All times are GMT -4. The time now is 2:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC