Anastasios Vlasopoulos
Anastasios Vlasopoulos

Reputation: 1802

Database and html DOM id mapping

I am working on a portal, where users can submit and retrieve data from a database via ajax and servlet responses. My question is how should i not reveal the real ids of the database in the html DOM. To be more spesific, i need to know which is the best way for mapping between "real" and DOMS's ids, and if this should be happening on server or client side.

Thanks!

Upvotes: 1

Views: 80

Answers (1)

Riad
Riad

Reputation: 3860

I think you would like to populate the doms with unique IDs to identify the element in the page. In that case there will be numerous ways. easy one would be a Fancy value put in the dom like

dom_id = 'itu~#'+(your_id*1001)+'#rand()'

Then when requested you can retrieve your_id with the '#'separated and divide by 1001 .

OR

be more complex you may write any complex function


Happy coding.

Upvotes: 1

Related Questions