javascript - jQuery data() with multiple parameters? -


i want add data variables element before causing specific behavior, may require adding more 1 data parameter. how can accomplish this?

     $("#dlg_box").data("r_redirect","index.php").dialog("open"); 

you can this:

var data = $("#dlg_box").data();    data.r_redirect = "index.php";   data.foo = "bar";  $("#dlg_box").dialog("open"); 

this taken here.

to retrieve values:

$("#dlg_box").data("r_redirect"); $("#dlg_box").data("foo"); 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -