From: Evertjan. on
Mark Read wrote on 19 apr 2010 in comp.lang.javascript:

> In article
> <eb26de02-5b21-4158-9dc7-3b04d990346e(a)b23g2000yqn.googlegroups.com>,
> schools_ring(a)yahoo.com (VK) wrote:
>
>> *From:* VK <schools_ring(a)yahoo.com>
>> *Date:* Mon, 19 Apr 2010 05:42:25 -0700 (PDT)
>>
>> On Apr 19, 4:21�pm, j80k-v...(a)dea.spamcon.org (Mark Read) wrote:
>> > I just thought that there might be a DOM/innerHTML way of doing
>> > it, and me
>> > just not able to see the wood for the trees.
>>
>> Well, the crucial question is if you need to update <map> data
>> (areas'
>> definitions) as well on each update or the image map only. For the
>> latter it is trivia with imgMapObjectName.src = newSrc
>>
>>
> It will have to be all together, the image is a worldmap, there are
> 'events' overlayed on the map as little coloured blobs. I would like
> to be able to hover the mouse over the blob and it tell me what the
> 'event' was. I purposely left that bit of info out, as I don't want to
> confuse the issue by having 'map' and 'mapmap'!!!!
>
> It's a graphical version of the Ham Radio DX Cluster I'm working on.
> The map part works, the mapmap is the issue. I hope that makes more
> sense ;-)

Not really. "mapmap" does not ring a bell.

Why not forget the HTML imagemapping altogether and just insert and
delete DOM-wize seperate absolutely positioned small images complete with
hover and click listeners?

You will have a choice having all the info on the page and refreshing the
whole page with frech info now and then, or having the pages javascript
ask the server for new information, and the latter technique is called
AJAX.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Mark Read on
In article <Xns9D5F9D96784D2eejj99(a)194.109.133.242>, exjxw.hannivoort(a)interxnl.net
(Evertjan.) wrote:

> *From:* "Evertjan." <exjxw.hannivoort(a)interxnl.net>
> *Date:* 19 Apr 2010 13:29:29 GMT
>
> Not really. "mapmap" does not ring a bell.
>
An image map for a world map... ;-)

> Why not forget the HTML imagemapping altogether and just insert and
> delete DOM-wize seperate absolutely positioned small images
> complete with hover and click listeners?
>
Simply? I'm not a js programmer, and I'm only doing it now because I can't do what
I want server side.

> You will have a choice having all the info on the page and
> refreshing the whole page with frech info now and then, or having
> the pages javascript ask the server for new information, and the
> latter technique is called AJAX.
Yes, it's the whole AJAX thing.. that and the fact that I've already done it in
PHP, MySQL, GD.

Fired with renewed enthusiasm, I've read a W3 tutorial on AJAX, and found something
that looks like what I was playing with before, but wrapped in XML. I'm greatly
optimistic, I'll see when I get home and start playing. I'll report back.

- Steve
From: Evertjan. on
Mark Read wrote on 19 apr 2010 in comp.lang.javascript:

> In article <Xns9D5F9D96784D2eejj99(a)194.109.133.242>,
> exjxw.hannivoort(a)interxnl.net (Evertjan.) wrote:
>
>> *From:* "Evertjan." <exjxw.hannivoort(a)interxnl.net>
>> *Date:* 19 Apr 2010 13:29:29 GMT
>>
>> Not really. "mapmap" does not ring a bell.
>>
> An image map for a world map... ;-)
>
>> Why not forget the HTML imagemapping altogether and just insert and
>> delete DOM-wize seperate absolutely positioned small images
>> complete with hover and click listeners?
>>
> Simply? I'm not a js programmer, and I'm only doing it now because I
> can't do what I want server side.

For a professional job, hire a programmer,
for your hobby, try something new.


>> You will have a choice having all the info on the page and
>> refreshing the whole page with frech info now and then, or having
>> the pages javascript ask the server for new information, and the
>> latter technique is called AJAX.

> Yes, it's the whole AJAX thing.. that and the fact that I've already
> done it in PHP, MySQL, GD.
>
> Fired with renewed enthusiasm, I've read a W3 tutorial on AJAX, and
> found something that looks like what I was playing with before, but
> wrapped in XML. I'm greatly optimistic, I'll see when I get home and
> start playing. I'll report back.

That is not what I mean with simple AJAX.

Just fetch data repeatedly woth xmlhttp [6 lines of code, see below] and
process those data clientside, that must be simple enoug to do.

If you cannot do that with in-browser Javascript and do not want to
learn, I doubt anyone in this NG will give you a free ride.

var xmlHttp = new XMLHttpRequest();
// older browser compatibility skipped

function getUrl(url) {
xmlHttp.open("GET",url,false);
xmlHttp.send();
return xmlHttp.responseText;
};


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Mark Read on
In article <Xns9D5FB3096BBC3eejj99(a)194.109.133.242>, exjxw.hannivoort(a)interxnl.net
(Evertjan.) wrote:

> *From:* "Evertjan." <exjxw.hannivoort(a)interxnl.net>
> *Date:* 19 Apr 2010 15:36:00 GMT
>
> Mark Read wrote on 19 apr 2010 in comp.lang.javascript:
>
> > In article <Xns9D5F9D96784D2eejj99(a)194.109.133.242>,
> > exjxw.hannivoort(a)interxnl.net (Evertjan.) wrote:
> >
> >> *From:* "Evertjan." <exjxw.hannivoort(a)interxnl.net>
> >> *Date:* 19 Apr 2010 13:29:29 GMT
> >>
> >> Not really. "mapmap" does not ring a bell.
> >>
> > An image map for a world map... ;-)
> >
> >> Why not forget the HTML imagemapping altogether and just insert
> and >> delete DOM-wize seperate absolutely positioned small images
> >> complete with hover and click listeners?
> >>
> > Simply? I'm not a js programmer, and I'm only doing it now
> > because I
> > can't do what I want server side.
>
> For a professional job, hire a programmer,
> for your hobby, try something new.

That pretty much sums it up, I had an idea, and almost made it work, but fell at
the last hurdle. :-/ Though only way forward was to "try something new".
>
>
> >> You will have a choice having all the info on the page and
> >> refreshing the whole page with frech info now and then, or
> having >> the pages javascript ask the server for new information,
> and the >> latter technique is called AJAX.
>
> > Yes, it's the whole AJAX thing.. that and the fact that I've
> > already
> > done it in PHP, MySQL, GD.
> >
> > Fired with renewed enthusiasm, I've read a W3 tutorial on AJAX,
> > and
> > found something that looks like what I was playing with before,
> > but
> > wrapped in XML. I'm greatly optimistic, I'll see when I get home
> > and
> > start playing. I'll report back.
>
> That is not what I mean with simple AJAX.
>
> Just fetch data repeatedly woth xmlhttp [6 lines of code, see
> below] and process those data clientside, that must be simple enoug
> to do.
>
> If you cannot do that with in-browser Javascript and do not want to
> learn, I doubt anyone in this NG will give you a free ride.

If I was starting from a clean slate, that's good advice, however, as I stated in
an earlier post, the number crunching is already done, and is working fine. So the
worldmap displays exactly how I want it. With the guidance offered here today it
looks like I'm armed with enough info to do it right, and get it working.

The code below looks much like what I saw on the W3 tutorial... and it's that that
I'm going to try later.

>
> var xmlHttp = new XMLHttpRequest();
> // older browser compatibility skipped
>
> function getUrl(url) {
> xmlHttp.open("GET",url,false);
> xmlHttp.send();
> return xmlHttp.responseText;
> };
>
>

Cheers again,

- Steve
From: Mark Read on
In article <memo.20100419130227.1036A(a)steve.cix.co.uk>,
j80k-vpfc(a)dea.spamcon.org (Mark Read) wrote:

> *Subject:* Refresh image map.
> *From:* j80k-vpfc(a)dea.spamcon.org (Mark Read)
> *Date:* Mon, 19 Apr 2010 13:02 +0100 (BST)
>
> Hi,
>
> I have an image that displays in graphical format, content from a
> database that is
> constantly changing. I would like to be able to display certain
> information using
> tool-tips by using an image map.
>
> The image refreshes using js every 10 seconds, meaning that the
> image map is soon
> out of date.
>
> The image and map are built using php, and the map (a flat file) is
> inserted using
> a php 'include'.
>
> I'm sure there must be a way of updating the map without reloading
> the page, but
> despite extensive googling, I've yet to come up with anything that
> works.
>
> Would someone give me a nudge in the right direction please? I
> daresay I haven't
> explained things too well, so feel free to ask me what I'm babbling
> on about. ;-)
>
> - Steve
>
and finally....

This appears to be a Firefox issue. Using Firebug, I can see that the
image map *IS* getting loaded.

Everything with respect to loading image and map is working fine, but I
cannot fathom how to tell FF to use the new map!!

It loads the image map OK first time, and then uses that one,
disregarding all attempts to tell it otherwise.

FWIW, Opera, Safari, and IE6+ seem to work fine.

Maybe a browser bug???


- Steve