JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/sunny/jquery-ui.css">
<form id="frm">
<a href="#" onclick="showInfo(1);">Info1</a>
<a href="#" onclick="showInfo(2);">Info2</a>
</form>
JavaScript
function showInfo(id)
{
if($('#_info_' + id).length == 0)
{
$('#frm').append('<div id="_info_' + id + '"></div>');
}
var path = '/F5mH3/6/show/';
openModal(path, id + 'Info window', '_info_' + id);
}
function openModal(path, title, dest_id, width, height)
{
var bfist = false;
var dest = null;
if(!width) width = 800;
if(!height) height = 600;
if(dest_id)
{
dest = $('#' + dest_id);
if(dest.html().trim() == '')
{
bfirst = true;
dest.load(path);
}
} else {
bfirst = true;
if($('#_modal_window').length() > 0) $('#_modal_window').detach();
$(body).append('<div id="_modal_window"></div>');
dest = $('#_modal_window');
dest.load(path);
}
if(bfirst)
{
var parent_id = dest.parent().attr('id');
dest.dialog({
title: title,
width: width,
height: height,
modal: true,
appendTo: '#' + parent_id
});
} else {
dest.dialog( "option", "modal", true );
dest.dialog('open');
/*dest.dialog({
title: title,
width: width,
height: height,
modal: true
});
*/
}
}
function closeModal(id)
{
alert(id);
$('#_info_' + id).dialog('close');
}