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
Post a Comment