473,383 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Any way to read custom html attributes in firefox/opera ?

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

Jul 23 '05 #1
3 5960
> "an*****@gmail.com" <an*****@gmail.com> wrote:
news:11**********************@o13g2000cwo.googlegr oups.com....

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


document.getElementById('myMap').getAttribute('nor thing')
--
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**

Jul 23 '05 #2
an*****@gmail.com wrote:
<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.
Jul 23 '05 #3
Thanks guys, that's exactly what I was after :)

Never heard mention of a getAttribute method before, so.. cheers!

AW

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their...
2
by: Henri Sivonen | last post by:
I try to associate DOM nodes with other objects. Assigning custom properties to DOM nodes works in Firefox and Safari. It also works with HTML nodes in IE6. However, it appears not to work with XML...
10
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox...
9
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a...
9
by: Dy | last post by:
Hi all I'm trying to creat a custom border like this: #container { width:770px; background: url(images/background.gif) repeat-y; padding:0; margin:0; }
3
by: mrsd2c | last post by:
I am building custom attributes as a means to pass data from the client to the server. To accomplish this task, a class of "postback" is applied to a link or button. When the link or button is...
16
by: Eric | last post by:
I have a user of a web application written in Java/JSP that is unable to login to the site simply because certain links on the page do not run when they are clicked. Other popups using Javascript...
2
by: Safalra | last post by:
Recently I've rewritten much of my old Javascript code to use DOM functions so that enhancements can be attached to documents without needing to alter the HTML code. I assumed that adding event...
12
by: RoLo | last post by:
Is there anyway to use the html document on IE as an XML document?
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.