-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackend.js
38 lines (35 loc) · 1.25 KB
/
backend.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// for debugging you may activate this:
// console.log(typeof jQuery);
if ( typeof jQuery == 'undefined' ) {
var fileref=document.createElement("script")
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", WB_URL+"/include/jquery/jquery-min.js");
if (typeof fileref!="undefined") {
document.getElementsByTagName("head")[0].appendChild(fileref);
}
}
var maxwait = 5000;
dlgJQueryDefer(0);
function dlgJQueryDefer(waittime) {
waittime = waittime + 100;
if(waittime>=maxwait) {
console.log('no jQuery in 5000 milliseconds...');
}
else {
// for debugging you may activate this:
//console.log('Waiting for jQuery...');
if (window.jQuery) {
if ( typeof jQuery.ui == 'undefined' ) {
var fileref=document.createElement("script")
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", WB_URL+"/include/jquery/jquery-ui-min.js");
if (typeof fileref!="undefined") {
document.getElementsByTagName("head")[0].appendChild(fileref);
}
}
}
else {
setTimeout(function() { dlgJQueryDefer(waittime) }, 100);
}
}
}