DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Swapping a map element (a DOM question)

  1. #1
    Join Date
    Apr 2007

    Unhappy Swapping a map element (a DOM question)

    Hi, I've developed code to replace the area elements of a given image map,
    as well as the corresponding img element. Basically, I'm acessing the map
    element from the DOM tree using the method document.getElementById('imagemap'), where imagemap is the map id.
    After that, I'm getting a reference to the 'areas' array, start a loop on it
    and remove all the area elements, with the removeChild method.
    The new area elements are created after getting from the server(using AJAX)
    their coordinates. Then the new area elements are appended to the image map object, replacing the old areas. The new image is loaded by simply changing
    the src attribute. Everything is working fine, but for one problem: Internet Explorer crashes when the map is changed. Mozilla also crashes, but not immediately, as Internet Explorer does.
    Does anybody have a clue for this problem? I can't seem what is happening, I've tried everything, even creating a new map element and replacing the old one, but the problem persisted.

    Andre Soares

  2. #2
    Join Date
    Nov 2007

    Dynamic image maps

    Di you manage to fix this. I am having exactly the same difficulty. If you can please let me know how you fixed it. It is driving me up the wall. I have been trying for a week to get this working.
    Many thanks

  3. #3
    Join Date
    Dec 2007
    The problem is this.

    If you have multiple polygon areas in your map, and later areas have fewer co-ords than previous areas, clicking on any of the later areas in IE 6/7 will crash the browser.

    I've seen a few posted solutions, but I have yet to try them.

    Apparently, if you place you images inside SPAN elements, this can overcome the problem.

Similar Threads

  1. STL map ( no unique element )
    By overule in forum C++
    Replies: 3
    Last Post: 02-25-2007, 09:23 AM
  2. Replies: 3
    Last Post: 01-28-2006, 08:25 AM
  3. Replies: 0
    Last Post: 10-18-2002, 01:17 PM
  4. accessing a DOM tree element
    By joe crew in forum XML
    Replies: 0
    Last Post: 04-26-2001, 12:27 PM
  5. Simple Java DOM question
    By Lenin in forum XML
    Replies: 0
    Last Post: 03-21-2001, 05:01 PM

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center