Giter Club home page Giter Club logo

Comments (4)

fedeverdi avatar fedeverdi commented on May 29, 2024

Same Issue here

from sweet-alert.

edsonrbispo avatar edsonrbispo commented on May 29, 2024

When the problem is not facing the browser, the alert appears again.

from sweet-alert.

uxweb avatar uxweb commented on May 29, 2024

@fedeverdi @edsonrbispo

This is related on how browsers manage caching, even when messages are taken out from the session, if you go back to a previous page, the bowser will display them.

Any idea on how we can fix this?

from sweet-alert.

eng-ahmednasser avatar eng-ahmednasser commented on May 29, 2024

this will help you
<script> if (window.performance) { var navEntries = window.performance.getEntriesByType('navigation'); if (navEntries.length > 0 && navEntries[0].type === 'back_forward') { console.log('As per API lv2, this page is load from back/forward'); } else if (window.performance.navigation && window.performance.navigation.type == window.performance.navigation.TYPE_BACK_FORWARD) { console.log('As per API lv1, this page is load from back/forward'); } else { console.log('This is normal page load'); @if (Session::has('sweet_alert.alert')) swal( {!! Session::get('sweet_alert.alert') !!} ); {{ Session::forget('sweet_alert.alert') }} // This will forget the alert data after displaying it :) @endif } } else { console.log("Unfortunately, your browser doesn't support this API"); } </script>

from sweet-alert.

Related Issues (20)

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.