So, I have the following code shown below to create a dialog using a div on a specific page:
$('#modal').dialog({
autoOpen: false,
width: 600,
height: 450,
modal: true,
resizable: false,
draggable: false,
title: 'Enter Data',
close: function() {
$("#modal .entry_date").datepicker('hide');
}
});
$('.modal').click(function() {
$('#modal').dialog('open');
});
Everything is working fine. However, now what I want to do is also open the link in the dialog box. For example, using something according to the code below:
<a href="/path/to/file.html" class="modal">Open Me!!</a>
I did this before, hard-coding the path, as in the code example below:
$('#modal').load('/path/to/file.html').dialog('open');
In this case, however, we cannot hard-code the path in javascript, as there will be several elements from the database.
At this moment, I'm struggling to figure out how to make this work. I am also convinced that the answer is really obvious, and I’m just determined to put up with smart people here at StackOverflow.
, , , , - , .