javascript - I can not unsubscribe web socket in Firefox -
i'm using atmosphere , angularjs creating client application. want unsubscribe ws when user click button in browser or change location page. code working in chrome 38, safari not working in firefox 33. i'm using angular-atmosphere-service handle ws.
link: github.com > spyboost > angular-atmosphere-service.js
var unbindhandler = $scope.$on('$locationchangestart', function (event, next, current) { var path = $location.path(); event.preventdefault(); showpopupalert('confirm', $('#popup_alert'), function () { try { atmosphereservice.unsubscribe(request); } catch(e) { $log.debug(e); } $scope.$apply(function () { unbindhandler(); $location.url(path).replace(); }); }, function () { }, errormes('client.changepage.on.pumping')); }); function showpopupalert(type, obj, confirmfunction, rejectfunction, message) { if (type != 'confirm') { obj.find('#btn-cancel').hide(); } else { obj.find('#btn-cancel').show(); } obj.find('#question').html(message); obj.modal('show'); obj.find('#btn-ok').unbind().bind('click', function () { obj.modal('hide'); if (confirmfunction !== 0) { confirmfunction(); } }); obj.find('#btn-cancel').unbind().bind('click', function () { obj.modal('hide'); if (rejectfunction !== 0) { rejectfunction(); } }); } open console log in firefox, got object
columnnumber
0 data
null filename
"http://192.168.1.102/ser.../libs/atmosphere-min.js" inner
null linenumber
635 message
"" name
"" result
2153644038 stack
"j@http://192.168.1.102/s...query/jquery.js:3:4749\n" proto
object { tostring=tostring(), message=undefined, name=undefined}
Comments
Post a Comment