Пока сделал так:
var jQ = false;
function initJQ() {
if (typeof(jQuery) == 'undefined') {
console.log('wait');
setTimeout('initJQ()', 50);
} else {
console.log('setBut');
setHtml();
}
}
function reportModuleShow(){
$('#modalReport').modal({opacity:80,
overlayCss: {backgroundColor:"#fff"},
closeClass : "simp-close",
minWidth : 700,
maxWidth : 700,
minHeight : 300
});
$('#modalReport').html('<center><img src="'+url+'/img/upload.gif"> Загружаем данные</center>');
}
function setHtml(){
add_css('jquery.simplemodal.css');
add_css('report_mod.css');
$('#reportModuleDiv').css('position', "fixed");
$('#reportModuleDiv').css('right', "10px");
$('#reportModuleDiv').css('top', "20px");
$("#reportModuleDiv").append('<a href="#" class="a_demo_one" onclick="reportModuleShow()">открыть</a>');
$("#reportModuleDiv").append('<div id="modalReport" style="display : none;"></div>');
}
var div;
var url = 'http://localhost:9000/public/';
function initreportModule(){
console.log('init');
div = document.createElement('div');
div.id = 'reportModuleDiv';
document.body.appendChild(div);
add_js('jquery-1.3.2.min.js');
add_js('jquery.simplemodal.js');
initJQ();
}
eval('initreportModule()');
function add_js (libs) {
var jq = document.createElement('script');
jq.type='text/javascript';
div.appendChild(jq);
jq.src = url + 'js/'+libs;
}
function add_css (libs) {
var report_modcss = document.createElement('link');
report_modcss.type='text/css';
report_modcss.rel='stylesheet';
div.appendChild(report_modcss);
report_modcss.href = url + 'css/'+libs;
}
и вызов
<!--Report Module-->
<script type="text/javascript" src="http://localhost:9000/public/js/initReportModule.js"></script>
<!--/Report Module-->