Giter VIP home page Giter VIP logo

Comments (7)

DigitalBrainJS avatar DigitalBrainJS commented on May 21, 2024 1

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:

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.

linkurzweg avatar linkurzweg commented on May 21, 2024 1

Just works perfectly! Thanks again :)

from safe-jsonp.

linkurzweg avatar linkurzweg commented on May 21, 2024

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.

DigitalBrainJS avatar DigitalBrainJS commented on May 21, 2024

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)
    jsonp
    Have fun :)

from safe-jsonp.

linkurzweg avatar linkurzweg commented on May 21, 2024

Wow, that's really cool! I will try it out as soon as I can! Thank you very much!! :)

from safe-jsonp.

DigitalBrainJS avatar DigitalBrainJS commented on May 21, 2024

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.

linkurzweg avatar linkurzweg commented on May 21, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.