Hi
Just a quick question - I guess this is more a 'standards' thing than
anything else.
I'm working on a digital mapping application. One of the things I'm
doing is outputting the IMG tag thus (just a sample):
< img id="myMap" src="somemap.gif" northing="1" easting="2" >
The reason I'm doing this is I'm looking to output some useful
information into the page from my asp.net source without resorting to
'tricks' like hidden input fields etc but still have them visible to
client-side JS.
In IE, I can read document.getElementById("myMap").northing, but when I
try this in Opera/Firefox these custom attributes aren't available.
Does anyone have any suggestions as to what I can do here?
Thanks in advance
AW
BootNic - 30 Jun 2005 17:26 GMT
> "andyjgw@gmail.com" <andyjgw@gmail.com> wrote:
> news:1120147190.531262.322170@o13g2000cwo.googlegroups.com....
[quoted text clipped - 21 lines]
> Thanks in advance
> AW
document.getElementById('myMap').getAttribute('northing')

Signature
BootNic Thursday, June 30, 2005 12:25 PM
If we were not meant to make mistakes we would not have a Department of Corrections.
*Unknown**
Richard Cornford - 30 Jun 2005 17:30 GMT
<snip>
> <img id="myMap" src="somemap.gif" northing="1" easting="2" >
<snip>
> In IE, I can read document.getElementById("myMap").northing,
> but when I try this in Opera/Firefox these custom attributes
> aren't available.
>
> Does anyone have any suggestions as to what I can do here?
The most reliable approach to reading custom attributes is the -
getAttribute - method (with the assumption that the attribute name is
case sensitive, even though it officially doesn't need to be in HTML).
Richard.
AndrewW - 30 Jun 2005 18:11 GMT
Thanks guys, that's exactly what I was after :)
Never heard mention of a getAttribute method before, so.. cheers!
AW