Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify filter a lot #73

Open
oliverjam opened this issue Apr 3, 2020 · 0 comments
Open

Simplify filter a lot #73

oliverjam opened this issue Apr 3, 2020 · 0 comments

Comments

@oliverjam
Copy link

There's probably a simpler way to achieve the filtering: your client-side JS currently fetches an HTML response, then replaces the entire content of the page with that HTML response.

This is essentially what an anchor tag does by default: when the user clicks it the browser sends a GET request to the URL in the href property, and then shows the HTML response as a new page.

So if you give your filter links hrefs like <a href="/filter?f=work"> etc then you could access that querystring value in the handler for the /filter endpoint and send the right response. You wouldn't need any client-side JS at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant