Howie, I have a similar problem and posted a question a few weeks ago without receiving any responses. In my situation we have one image that is basically a "front" and "back" image. However, the image map needs to have different hot spots depending on if the viewer is looking at the front or the back. I have tried to use html() to re-write the image map html code and then remove() to take out the old. I'm able to see the image map code swap out, unfortunately the hot spots stay are still the same as the removed image map. It's almost like the browser needs to reload the DOM after the HTML change, but that doesn't make any sense to me.
I'm fairly new to jQuery and not very advanced with JavaScript so this has been a major challenge. Right now that project has been put on hold so I'm not sure when I'll get back around to it, when I do and if I find a solution I will post the solution here. Either way I would like to make jQuery work.. I really don't want to use Flash. Spencer On Aug 7, 6:48 am, Howard Jones <[EMAIL PROTECTED]> wrote: > [sorry if this is a duplicate - it looks like I sent the first one to > the old list address] > > My application uses client side imagemaps to allow the user to interact > with a server-drawn dynamic image. So to do that, each time the image is > changed, it needs to download a new imagemap with new areas (things have > moved within the image). > > Here's my code to do that: > $.get('editor-backend.php',{ map: mapfile, cmd: "imagemap" }, > function(cont) { > $('map#weathermap_imap').empty() > $('map#weathermap_imap').append(cont); > console.log('I did try'); > console.log(cont); > }); > > The console log shows that a valid chunk of <area> tags was fetched, but > using firebug's HTML inspector, all that *actually* appears between the > <map> tags is ', ' - a comma, and a space. If I try and append a small > piece of text it's OK (but useless). If I try and append a single <area> > 'by hand', that fails too, as does using the alternative > .append($('area')). > > Here's a small piece of the imagemap: > > <area alt="NODE:node00364" id="NODE:node00364" shape="rect" > coords="126.5,217.5,319.5,234.5" />, > <area alt="LINK:node00364-node20108:2" id="LINK:node00364-node20108:2" > shape="poly" > coords="224,222,254,231,275,237,298,244,334,255,335,251,348,263,330,266,332,262,296,252,272,245,252,238,221,229" > /> > <area alt="LINK:node00364-node20108:0" id="LINK:node00364-node20108:0" > shape="poly" > coords="475,297,462,293,444,288,424,281,400,274,375,267,364,264,366,260,348,263,361,275,362,271,373,275,398,282,421,289,442,295,459,300,472,304" > /> > > Is there some limitation on dealing with imagemaps? Am I doing something > dumb, or is this a bug? > > The same imagemap delivered to the browser as part of a 'traditional' > page works just fine... has anyone else done this kind of thing > successfully? Thanks in advance for any pointers to save my sanity :-) > > Howie