473,386 Members | 1,817 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,386 software developers and data experts.

store information in a tag?

I want to store some state infomation for each DIV tag on a page. Which
property of the DIV tag should I use for this?
ie I want to iterate through all DIV tags, and associate each with a
'state' and store that information in the tag

Jun 9 '06 #1
5 1617
Kourosh wrote:
I want to store some state infomation for each DIV tag on a page. Which
property of the DIV tag should I use for this?
ie I want to iterate through all DIV tags, and associate each with a
'state' and store that information in the tag

Why not just add a property 'state' to each div?

--
Ian Collins.
Jun 9 '06 #2
Kourosh wrote:
I want to store some state infomation for each DIV tag on a page. Which
property of the DIV tag should I use for this?
ie I want to iterate through all DIV tags, and associate each with a
'state' and store that information in the tag


Have you thought about storing the states in a seperate javascript
object? Perhaps you can assign id's to the DIV tags that you want to
store states for and use those id's to map them to states in a seperate
object.

Robert.
Jun 9 '06 #3

Robert wrote:
Kourosh wrote:
I want to store some state infomation for each DIV tag on a page. Which
property of the DIV tag should I use for this?
ie I want to iterate through all DIV tags, and associate each with a
'state' and store that information in the tag


Have you thought about storing the states in a seperate javascript
object? Perhaps you can assign id's to the DIV tags that you want to
store states for and use those id's to map them to states in a seperate
object.

Robert.


I see. How would i use the IDs to efficiently map to an array of
states. Is there a hashtable?

Jun 9 '06 #4

Ian Collins wrote:
Kourosh wrote:
I want to store some state infomation for each DIV tag on a page. Which
property of the DIV tag should I use for this?
ie I want to iterate through all DIV tags, and associate each with a
'state' and store that information in the tag

Why not just add a property 'state' to each div?

--
Ian Collins.


Oh hah thanks. I didnt know I could do that :)

Jun 9 '06 #5
Kourosh wrote:
Robert wrote:
Kourosh wrote:
I want to store some state infomation for each DIV tag on a page. Which
property of the DIV tag should I use for this?
ie I want to iterate through all DIV tags, and associate each with a
'state' and store that information in the tag


Have you thought about storing the states in a seperate javascript
object? Perhaps you can assign id's to the DIV tags that you want to
store states for and use those id's to map them to states in a seperate
object.

Robert.

I see. How would i use the IDs to efficiently map to an array of
states. Is there a hashtable?


Each object in javascript works quite similar as a hashtable.
Take for example this code:

function StateStorage()
{
var map = new Object();

this.store = function(id, state)
{
map[id] = state;
}

this.retrieve = function(id)
{
return map[id];
}
}

var stateStorage = new StateStorage();
stateStorage.store(divId, "my state object");
Jun 12 '06 #6

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

Similar topics

9
by: F. Da Costa | last post by:
Hi, Does anybody know why IE5+ does *not* honour array objects (like a table) across a session? Example: Frame A contains a var tableVar which is set via form Frame B (on init) using...
2
by: Peter Rilling | last post by:
How does Windows store passwords that it uses? For instance, when you install a service, you can provide it the username and password. This information is stored somehow so that at a later date...
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
2
by: John Wildes | last post by:
hello I was wondering if someone could point me in the direction of information on using app.config to store string variables. I have a couple of variables that store path information for file...
1
by: rdemyan via AccessMonster.com | last post by:
I'm trying to implement a licensing scheme. There are three types of licenses: Trial - good for 30 to 60 days Interim - good for 1 year Fully Paid - no expiration Everything is working fine...
18
by: siddharthkhare | last post by:
Hi All, what is the diference between these two cache control header. no-cache and no-store. I have read the w3.org explanation. So lets say I am using only no-cache ....my understanding is...
4
by: Dave | last post by:
I have some data values that will will rarely change over the life of the program. I don't think it is wise to save it in a database. Is it ok to save them in Properties.Settings if I have many...
11
by: mwebel | last post by:
Hi, i had this problem before (posted here and solved it then) now i have the same problem but more complicated and general... basically i want to store the adress of a istream in a char* among...
3
by: gordon | last post by:
Hi I am looking to store some details about a user's configuration choices, in particular the place where they have installed some data files, the OS that they use, and their Windows user name. ...
1
by: Joe | last post by:
Hello, I'm currently using a C# class library which is also converted quickly to a console app by adding a MAIN and adjusting the building configuration. I'm using this page as a reference to the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.