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
1
vote
1 answer

Paper-tabs with links display issue

I am writing a polymer single page website using page.js, just like in the polymer-starter-kit. Instead of using a paper-menu for the routing, I am using paper-tabs. So the routing is working and everything, but I can't get the paper-tabs to look…
arazzy
  • 495
  • 1
  • 8
  • 23
1
vote
1 answer

Polymer + page.js flash notifications with paper-toast

I'm building a mid sized app with Polymer and used the Polymer Starter Kit to kick things off which uses page.js for routing. I want to implement flash message functionality using the paper-toast element. In other technologies/frameworks this is…
markstewie
  • 9,237
  • 10
  • 50
  • 72
1
vote
1 answer

Cannot perform routing with pushstate and various js routers

I am not sure if I understand well the situation with pushstate and routing but I am stuck trying to route a single page app using either pagejs or grapnel or other similar javascript routers. What I want is to be able to navigate through my program…
arisalexis
  • 2,079
  • 2
  • 21
  • 42
1
vote
1 answer

Polymer Page.js paper-header-panel element scroll top when menu item selected

I have a problem with paper-menu and paper-header-panel. When I click on my paper-menu items and webcomponents has correctly loaded the relative page, this one appears in the previous scrolled position. How I can set to scroll on top when the click…
Marco
  • 325
  • 2
  • 9
1
vote
3 answers

cant make new routing in Polymer 1.0 starter-kit (via page.js and iron-page)

i am new to polymer and i just start it with Polymer 1.0 starter-kit i understand the structure of Polymer app and used the page.js for making a new rout like this. window.addEventListener('WebComponentsReady', function() { // We use Page.js…
Babakslt
  • 199
  • 1
  • 10
1
vote
1 answer

How to instantiate route in a Polymer app located on an internal page of a site using page.js

I'm attempting to run a Polymer app on an internal page of a site and having an issue setting the initial route. The app is located at 127.0.0.1:8080/hardware on local dev. My custom Element looks like this:
Bonk
  • 447
  • 10
  • 25
1
vote
1 answer

Polymer Routing with page.js do not add hashbang to URLs when links are opened in new tab

I am using polymer starter kit which uses page.js for routing. The hashbang page option is set to true in routing.html // add #! before urls page({ hashbang: true }); when links such as are clicked, the #! is…
Optimus Pette
  • 3,250
  • 3
  • 29
  • 50
1
vote
1 answer

using page.js with sinatra (or rails)

I would like to know if it's possible to use page.js with sinatra. My images's route are intercepted by Sinatra instead of Page.js get '/' do erb :index end __END__ @@ layout page.js
Papouche Guinslyzinho
  • 5,277
  • 14
  • 58
  • 101
1
vote
0 answers

capture a regex group in url with pagejs

I want more than one optinal parameters in pagejs so I cannot go like this /controller/action/:p1?/:p2? because If p1 is not provided, value will be set to p1 instead of p2. So I went for this url form: /controller/action/p1/:p1/p2/:p2 but this…
alexserver
  • 1,348
  • 3
  • 15
  • 30
0
votes
1 answer

I can't make work a simple JavaScript app using page.js for the routing functionality

I am trying to learn how a small routing library for javascript apps works - page.js So I made one very tiny app for my own learning purposes but for some reason i can't make it work properly. The app is really as simple as it gets - one folder…
Miro
  • 1
  • 1
0
votes
1 answer

page.js with svelte `The requested URL was not found` when entering URL manually or refreshing despite passing --single flag in package.json

I'm new to the whole Javascript & svelte ecosystem and am trying to build an app with svelte.js and using flask to serve it. The issue is I get The requested URL was not found when i enter the path manually or refresh the page. This happens despite…
0
votes
1 answer

How to use page.js with SVELTE and retain dynamic route content while editing

I am using page.js with SVELTE and it works. The problem: My app lets users store data via a form and the data is stored in indexedDB (I am using Dexie.js to talk to IndexedDB). The stored data is used to create dynamic routes. Example: A user…
William
  • 4,422
  • 17
  • 55
  • 108
0
votes
1 answer

Svelte page.js routing - Can't get passed-in props for dynamic component

I have a problem with page.js routing. If I go from settings to a dashboard, i get the passed in props. If I go from dashboard to dashboard nothing is logged out... Can anyone help? App.svelte let page, props; router("/settings", () => (page =…
Ivan
  • 1,967
  • 4
  • 34
  • 60
0
votes
0 answers

Javascript code not being executed on one page on my website using page.js

EDIT : @Mike 'Pomax' Kamermans, sorry about the link shortners, you're absolutely right! I have added a datepicker to a form on my website but it is only working when i browse directly to the page, for example if you open the first link directly…
0
votes
1 answer

How to navigate to URL without full reload using page.js?

I want to redirect the user after submitting a form without reloading the page (document). I tried, page("./newurl/18/meetings"); When I click on a link link it works as expected.
Mike Casan Ballester
  • 1,690
  • 19
  • 33