Comments (5)
You can't use onbeforeunload
because one of the things that handler might do is ask "There are server requests in progress. Do you want to stop those, exit, and lose your work?" If the user were to cancel the damage would still be done.
I agree the dependency here is unfortunate and undesired.
from jquery.
We could guard the whole block on jQuery.fn.on
, though, basically restricting the fix to more complete builds.
from jquery.
We're not doing anything special for unload
event in effects module and that hack is relative for oldIE only, plus we already have guard through checking for presence of ActiveXObject
object (although this code path will be executed in newer version of IE).
So why we can't use attachEvent
method directly?
from jquery.
@gibson042 Guarding the block works, and justifies not having it listed as a dependency I suppose.
@markelog I had remembered, falsely it seems, that unload
didn't work with attachEvent
. So perhaps we can just check for attachEvent
as our feature detect and attach it that way? This problem is supposed to be fixed in IE11 where attachEvent
isn't present.
from jquery.
So perhaps we can just check for attachEvent as our feature detect and attach it that way?
I think so, yes. I can provide patch today.
from jquery.
Related Issues (20)
- Uncaught TypeError: Cannot read properties of undefined (reading 'createElement') HOT 1
- Event triggering is being captured incorrectly HOT 5
- CSP problem HOT 8
- AJAX with zero form fields does not send `Content-Type` header HOT 1
- manual triggering of pointer event
- jquery destructuring assignment HOT 3
- 网络安全漏洞修复 HOT 1
- Prepare a 4.0 blog post & an upgrade guide HOT 2
- Jquery upgrade from 3.6.0 to 3.7.1
- Cross Site Scripting (DOM) issue
- Treeveiw not woking with jquery 3.7.1 HOT 10
- DOM based Cross-Site Scripting (XSS) HOT 1
- Uncaught TypeError: Cannot read properties of undefined (reading 'createDocumentFragment') in jQuery 3.7.1 HOT 1
- Content-Security-Policy / nonce error in DOMEval HOT 2
- Facing jQuery Selector issue after upgrading from 1.7.1 to 3.7.1 HOT 1
- jQuery .load function errors if loading html with auto-removing script tag HOT 2
- Strange error behavior of event delegation when customizing jQuery HOT 3
- invalid assignment left-hand side in jquery-3.7.1.min.js HOT 7
- Update the rules for boolean attributes for 4.0 HOT 8
- Deprecation / Warning | jQuery CDN HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.