Git Product home page Git Product logo

Comments (2)

mtrpcic avatar mtrpcic commented on July 19, 2024

PathJS is meant as a routing platform, and that means the hash change event is used to handle that. The hash should only be changed if you want your users to be able to navigate back from, and forward to, that state in your web application. If you are just updating it to store some information, I recommend a different method. You could have the response of your AJAX call change the route, and have the route change perform the action you're AJAX response is currently doing.

from pathjs.

digiprop avatar digiprop commented on July 19, 2024

In most cases, we use PathJS exactly as you described (updating the route and causing the ajax request to trigger.) However there is one case where we need to do this in reverse. Basically the user clicks on a link and we need data from the server that we don't have yet. This data includes a search key that tells path to load the correct search on page load. BackboneJS and other frameworks have a navigate feature that does exactly as i described. I really like PathJS however and want to keep using path. I actually built a navigate function in path that skips navigation and resolves the issue that I was having.

from pathjs.

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.