Comments (7)
Hello! Unfortunately, there are no JSONP libraries that could completely interrupt the pending request. Since each JSONP library uses a script element as a transport wich does not support any abort or timeout methods, there is no practical way to cancel a request at the http level. This is a well-known limitation of the browser DOM. You can read more about this issue here:
- https://stackoverflow.com/questions/6472509/abort-jsonp-ajax-request-with-jquery
- https://stackoverflow.com/questions/5506425/how-to-set-a-timeout-for-loading-a-external-javascript-file-which-is-down
- https://maxchadwick.xyz/blog/script-tag-timeout-attribute
So, if possible, you should use ajax (xmlhttprequest / fetch) instead with Access-Control-Allow-Origin: * header from server side, because this technology fully supports the abort method at all levels.
from safe-jsonp.
Just works perfectly! Thanks again :)
from safe-jsonp.
Hello! I was afraid that this might be the case but couldn't really find the information I needed. for now I am limited to JSONP unfortunately... Anyway, thank you very much for clearing that up and explaining it in detail :)
from safe-jsonp.
I have made some research & testing so it seems i have found some experimental solution wich is made possible by the availability of a sandbox mode in my package, classic JSONP packages can't provide this. So, I have updated the package to 0.5.0 and added ability to abort related http request. This feature will work only when:
- "abortable" option is set
- sandbox mode is activated and supported by a browser (except all IE, I hope you don't need them)
Have fun :)
from safe-jsonp.
Wow, that's really cool! I will try it out as soon as I can! Thank you very much!! :)
from safe-jsonp.
Hmm... Sadly, but it doesn't work perfectly :) It seems Edge browser has some bug and this solution doesn't work completely with it. I'm looking for some aditional hack to fix this bug for microsoft's freaky child, but currently i have not 100% working solution...
from safe-jsonp.
Ah I see. I'm fortunate that I don't have to rely on Microsoft's stupid browsers for my project...
from safe-jsonp.
Related Issues (1)
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 safe-jsonp.