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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -