Questions tagged [page.js]

Micro client-side router inspired by the Express router

page.js is a Micro client-side router inspired by the Express router (~1200 bytes)

Installation

There are multiple ways to install page.js. With package managers:

$ npm install page # for browserify
$ component install visionmedia/page.js
$ bower install visionmedia/page.js

Via CDN and script tag:

<script src="https://cdn.rawgit.com/visionmedia/page.js/master/page.js"></script>

Useful Links

42 questions
6
votes
0 answers

AppCache misbehaving in Safari, Firefox

I'm having some major trouble with AppCache. I've got a single page application (with real URLs using using Page.js and loading HTML from the server on page load, (dispatch: false) It's running on Bode.js, in particular it's a Sails.js app. I've got…
Naman Goel
  • 1,525
  • 11
  • 16
4
votes
1 answer

server side rendering using webpack

I am using Reactjs, webpack along with page.js (routing) to build a webapp. Webpack gives me a bundle.js which is loaded on the client side. I found out the og Meta tags can't be crawled if I am loading them on the client so, I have to implement it…
Vamshi Kolanu
  • 409
  • 2
  • 5
  • 16
3
votes
0 answers

React-router vs. Page.js

I want to compare react-dom-router vs page.js for routing in react.js. The examples I am using are: import React from "react"; import render from "react-dom"; import { BrowserRouter as Router, Route, browserHistory, Link } from…
learner
  • 4,614
  • 7
  • 54
  • 98
2
votes
2 answers

anchor link in Svelte app using page.js routing

I have an anchor tag on a page in my Svelte app. The link to the anchor works on the page itself, but I can't link to the anchor from another page. And when I enter the URL with the anchor, the page doesn't scroll down. I need to be able to give…
sprucegoose
  • 486
  • 9
  • 25
2
votes
1 answer

How to fix MIME errors on refresh when using URL parameters

I don't know if I will be able to explain good enough but.. I have a setup like this page(navigationMiddleware); page('/', homeView); page('/login', loginView); page('/register', registerView); page('/movies', catalogView); page('/create',…
2
votes
0 answers

Synchronous XMLHttpRequest on the main thread is deprecated issue in ASP.NET MVC & Page.js

In order to make our application SPA, we have used a third party library Page.js along with ASP.NET MVC. Page.js Reference: https://visionmedia.github.io/page.js/ We perform basically two tasks by making use of Page.js library. First, we hit some…
Ankush Jain
  • 5,654
  • 4
  • 32
  • 57
2
votes
1 answer

Polymer 1.0 - How to use 'page' to route app and change URL

Working from the Polymer 1.0 Starter Kit, I'd like to set up a new route, but I need to fire it from a function in my app.js file rather than through routing.html app._loadProject = function(e) { // do stuff here // after finished, route to our…
Typel
  • 1,109
  • 1
  • 11
  • 34
2
votes
0 answers

Using page.js, is it possible to have nested data routes?

For example, I have a route between multiple pages like login, home, contact etc. But under home I would like to create a data route for a drawer panel which would route to content within the home page. Or something like swipe-pages between tabs? Is…
tehman
  • 828
  • 2
  • 11
  • 34
2
votes
0 answers

not able to do routing properly in page.js

I am using page.js for routing in a Single Page Application. For testing purpose, I am using npm http-server. I am not able to do routing. I am not sure what I am missing. following is my code: index.html: test page!
Bharat Soni
  • 2,824
  • 6
  • 23
  • 48
2
votes
1 answer

Polymer app routing partials with Page.js

I'm using the Polymer Starter Kit and would like have each route's content in a separate file (/pages/games.html, /pages/movies.html, etc) but I can't find any examples of this. Could someone point me in the right direction? Or is it not possible or…
Mike
  • 1,000
  • 1
  • 10
  • 18
1
vote
1 answer

How can I use page.js with Svelte and Vite?

I've set up a pretty simple Svelte app. It uses page.js for routing, and uses Vite as the build tool. There's a map of california on the landing page. When I'm running the app locally via npm run dev, I can either click on a county OR use the…
sprucegoose
  • 486
  • 9
  • 25
1
vote
1 answer

How to call parent +page.js from more specific route in SvelteKit?

I'm using SvelteKit to develop an application, and I want to call the parent route's (i.e. / from /products) +page.js on page load, however it simply doesn't call it, despite not having a +page.js in /products. This is how my file system…
Basil
  • 488
  • 1
  • 15
1
vote
1 answer

page.js library: how to enable onbeforeunload?

I'm building a single-page application using page.js as the router. The default window.onbeforeunload event doesn't seem to fire when changing pages within the SPA. How can I implement something similar, allowing me to selectively cancel the page…
Ryan Griggs
  • 2,457
  • 2
  • 35
  • 58
1
vote
1 answer

Serve static files in express doesn't work in different routes, only in root route

I have make some research about this issue, but all the possible solutions doesn't work for me I don' know why. I am using page.js and express to develop my little app. When I serve my static files all works fine in my "/" (root) route. But when I…
maoooricio
  • 2,249
  • 3
  • 15
  • 19
1
vote
0 answers

Internet Explorer 8,9 reload loop with client router (Page.js + history.js)

I am woriking on a project and using page.js client router which uses History API (Project works perfectly fine in all browsers, IE 10+). But it doesn`t work on IE 8, 9. When I am trying to open my web application base path in IE lt9 I get infinite…
1
2 3