I need to pass the title of the jQuery dialog variably.
I am trying to use the "data" property like this:
jQuery( "#dialog" ).data( 'the_title', 'John Doe Dialog' ).dialog( "open" );
jQuery( function() {
jQuery( "#dialog" ).dialog({
title: jQuery( "#dialog" ).data( 'the_title' ),
});
});
But it is not working, it is displaying the default title.
Any thought please?