Giter Site home page Giter Site logo

ianrogren / jquery-backdetect Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 25.0 33 KB

jQuery backDetect is a jQuery plugin that is used to determine when a user clicks the back button and fire a callback function.

JavaScript 22.20% HTML 21.44% CSS 56.36%

jquery-backdetect's People

Contributors

ianrogren avatar irogren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jquery-backdetect's Issues

when back, forward button disappeared

  1. Open a.html and then go to b.html in the same tab.
  2. From b.html, click the browser back button it will redirect back to a.html but forward button also disappeared after some milliseconds.

1x1.png URL change

Correct me If I'm wrong but the 1x1.png file URL used in the <iframe> is hardcoded and can't be personnalized with frameDataSrc ?

$('<iframe src="1x1.png?loading" style="display:none;" id="backDetectFrame" onload="jQuery.fn.frameInit();"></iframe>').appendTo(backDetectValues.frameThis);

Thanks !

Preventing default action

I'd like to submit an Ajax request when the user clicks the back button, but I can't figure out how to prevent the default action happening i.e. the browser goes to the previous page.

Is there something I'm missing on this?

Browser back works only if user clicks on the current web page.

Back event gets triggered only when only when I click or do some actions on the current page

the below function gets triggered only when user manually do some click on the web page.
$.fn.frameInit = function initFrame() {

Scenario1:
Open new tab in Chrome browser and load a.html , go forward to the next page (say, b.html).
click on browser back button. The plugin dosent work

Scenario2:
Open new tab in Chrome browser and load a.html , go forward to the next page (say, b.html).
Now click somewre around the page (b.html) or press any key on the keyboared.
Now click on the browser back button. the plugin works as expected..

Something odd

Thank you for this library.

If I trigger an alert the page will stay still until I close the alert, but if I use a bootstrap model it will take a second (I am not using the delay option) or two after showing the modal and it will go back to the previews page.

What am I missing?

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.