got this JS working
This commit is contained in:
parent
9b1ed7a720
commit
9648acc7a4
2 changed files with 26 additions and 31 deletions
|
@ -13,29 +13,26 @@ connfailed=
|
|||
' </div>' +
|
||||
'</div>' ;
|
||||
|
||||
function longpoll(url, divid) {
|
||||
(function( $ ) {
|
||||
$.ajax({
|
||||
'url': url,
|
||||
'dataType': 'html',
|
||||
'success': function(data, status, jqxhr) {
|
||||
$('#' + divid).replaceWith(data);
|
||||
connfails=0;
|
||||
return 1;
|
||||
},
|
||||
'error': function(jqxhr, msg, e) {
|
||||
connfails=connfails+1;
|
||||
if (connfails > 3) {
|
||||
// blocked by many browsers
|
||||
window.close();
|
||||
$('#modal').replaceWith(connfailed);
|
||||
$('#modal').modal('show');
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
function longpoll(url, divid, cont) {
|
||||
$.ajax({
|
||||
'url': url,
|
||||
'dataType': 'html',
|
||||
'success': function(data, status, jqxhr) {
|
||||
$('#' + divid).replaceWith(data);
|
||||
connfails=0;
|
||||
cont();
|
||||
},
|
||||
'error': function(jqxhr, msg, e) {
|
||||
connfails=connfails+1;
|
||||
if (connfails > 3) {
|
||||
// blocked by many browsers
|
||||
window.close();
|
||||
$('#modal').replaceWith(connfailed);
|
||||
$('#modal').modal('show');
|
||||
}
|
||||
});
|
||||
})( jQuery );
|
||||
else {
|
||||
cont();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue