javascript - What is the best practice to store hidden values in web apps, without using the classic html form? -


i hope question not useless ! , problem me .

when want build user interface in web application (add, delete ,edit ) use html forms + hidden inputs store some values such "user id" deleted,edited ..

i want build same interface using " anchors + span + div " insteand of "hidden inputs" . when write javascript code handles "onadd ,ondelete , onedit" events need know deleted ? what id kicked out database ?

the question , how store id in html tags without using hidden inputs ?

what i'm using :

<div id="userid_133421" >     <span>name</span>     <a id="ondelete">delete</a>     <a id="onedit">edit</a> </div>  $("#ondelete").click(function({          user_id = $(this).parent().attr('id').substring($(this).attr('id').indexof('_')+1);          $.post('index.php?component=user&action=remove&user_id=' + user_id, function(data){          });     })); 

i checked websites such dropbox , , found don't use technique store values (such file id) , , more don't use classic hidden inputs that!

i want know how manage code choose best way ? :(

if using jquery, why not use data() function store information?


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -