Pass a variable to JQuery UI dialog

You can try using the .data() method to store data for you. Take a look at this answer
Passing data to a jQuery UI Dialog

For example to pass a variable, you can store it using the data function, before opening the dialog

$("#dialog_div")
.data('param_1', 'whateverdata')
.dialog("open");

Then you can get this back by:

var my_data = $("#dialog_div").data('param_1')

Leave a Comment