I try to make my code more modular. Currently I include jspf file which contain code for jQuery Dialog into any required jsp file.
I want to put this HTML code into JS file, so I only need to include one .js file instead of two:
function activateZoomingDialog() {
var tmpId = ???;
tmpId.innerHTML = '<input type="text"></input>...';
$(tmpId).dialog({
modal: true,
title: 'Select area size',
...
});
}
How to create and maintain (life-cycle) temporary DOM structure? jQuery solution will be acceptable.
var tmpId = $("<div>");then remove it when you destroy the dialog.