Questions tagged [push.js]

Push Push.js is the engine that connects Ratchet pages together with AJAX and the history api. Push.js is listening to all clicks on a page, so just make sure it's included and link something in your Ratchet project up.

Push

Push.js is the engine that connects Ratchet pages together with AJAX and the history api. Push.js is listening to all clicks on a page, so just make sure it's included and link something in your Ratchet project up.

<!-- A one.html link -->
<a href="two.html">Two</a>

This will use push to replace everything in the .content div with the .content of two.html. Also, it will either update or remove .bar-nav and .bar-tab according to their presences in two.html.

Now that pages are being loaded through push, it's easy to specify transitions for animations between pages. There are three different transitions to chose from: fade, slide-in, or slide-out.

<!-- An one.html link that animates to two.html -->
<a href="two.html" data-transition="fade">Two</a>

A working version of push:

<header class="bar bar-nav">
  <h1 class="title">Push</h1>
</header>
<div class="content">
  <div class="card">
    <ul class="table-view">
      <li class="table-view-cell">
        <a class="navigate-right" href="../two.html" data-transition="slide-in">
          Load new page with push
        </a>
      </li>
    </ul>
  </div>
</div>

Have a link you don't want to intercepted by push? Try this:

<!-- Use data-ignore="push" to prevent the push.js interception -->
<a href="http://www.google.com" data-ignore="push">Google<a>

Push.js binds an event to the document that returns a detail object and can be used to fire a callback.

// Only needed if you want to fire a callback
window.addEventListener('push', myFunction);
31 questions
10
votes
8 answers

how to enable push.js ajax content loader with ratchet

i am trying to implement the push.js engine from ratchet: http://maker.github.com/ratchet/#push i downloaded the ratchet files from here: http://maker.github.com/ratchet/ratchet.zip and am using apache to serve all js, css and html. all files are in…
SeanPlusPlus
  • 8,663
  • 18
  • 59
  • 84
7
votes
2 answers

Execute custom script after page loaded with Ratchet\Push.js

So on the GitHub documentation for Ratchet 2.0.2 I found the following statement. Script tags containing JavaScript will not be executed on pages that are loaded with push.js. If you would like to attach event handlers to elements on other…
Schmalzy
  • 17,044
  • 7
  • 46
  • 47
6
votes
1 answer

ratchet push.js with phonegap (cordova)

I use Ratchet. My phonegap app has two pages, containing jquery.js, ratchet.js, and blockui.js (jQuery-based). index.html: 2.html 2.html:
5
votes
4 answers

Executing several JS files with Ratchet push.js library

I´m developing a Phonegap app with Ratchet 2.0.2 using push.js for transition between pages. Everything is working smoothly but a couple of hours ago I stumble upon this: Script tags containing JavaScript will not be executed on pages that are…
Danito
  • 51
  • 1
  • 5
4
votes
2 answers

Uncaugth reference error custom event not defind in the file ratchet

Hai i am new in phonegap and ratchet framework.I am trying to load external script with push.js. Here is my js file contents function init(){ document.addEventListener('deviceready', onDeviceReady, false); function onDeviceReady(){ …
shamon shamsudeen
  • 5,466
  • 17
  • 64
  • 129
3
votes
1 answer

Alternative to Push.js

I'm building a hybrid app with Phonegap, but I don't want to use Ratchet, is there any alternative to Ratchet's push.js? I want the user to move between pages without page refresh.
eozzy
  • 66,048
  • 104
  • 272
  • 428
3
votes
1 answer

Knockout JS plays nicely with Ratchet and push.js until I add a data-transition

I am using the Ratchet.js/push.js library to create the UI for a mobile web app. In this library, links are handled by "pushing" the to-be-loaded file into the ".content" DOM element rather than loading the entire page. However, push.js does not…
Mark Brittingham
  • 28,545
  • 12
  • 80
  • 110
3
votes
3 answers
2
votes
0 answers

Using Ratchet push.js in single page mobile app

I'm developing a cordova based mobile app using Backbone and Ratchet. The app is based on single based architecture where the page are created and changed dynamically. From my knowledge, push.js works well with pages loaded from server through AJAX.…
VJAI
  • 32,167
  • 23
  • 102
  • 164
2
votes
0 answers

Run function when XHR finished loading (jQuery)

I'm using the push.js library with Ratchet, which loads pages using AJAX then changes history.pushState(). I was wondering if there is any way to run a function when an XHR request has finished?
Dan
  • 53
  • 4
2
votes
0 answers

push.js Uncaught TypeError: Cannot read property 'removeChild' of null

When I click a link on my page the URL updates and I see the correct page content flash momentarily, then the content of the previous page takes hold. This only appears to happen when I use the data-transition attribute. The same problem occurs both…
pressrobin
  • 21
  • 2
2
votes
0 answers

i need help getting ratchet push.js fade transition to work?

this is a basic example calling "two.html", with the fade transition and this is two.html
Jermaine
  • 770
  • 7
  • 9
1
vote
0 answers

Install push.js failed

I'm in the middle of deploying my app. Local, I can successfully install the packge push.js from npm but up on cloud, the install script failed error Can anyone help me?
1
vote
0 answers

How to remove URL from push.js notifications?

I am using push.js for showing descktop notifications.It showing URL inside the notification which I want to hide. How do I do that?
Pawan Singewar
  • 331
  • 1
  • 3
  • 7
1
vote
0 answers

html5 audio only loading after refresh with ratchet, push.js

I'm clicking through to a page that has html5 audio on a mobile site that uses Ratchet.js ( and push.js ) but the html5 audio elements only load if I do a full page refresh or if I use data-ignore="push" on the link. Why is this and how can I make…
raphael_turtle
  • 7,154
  • 10
  • 55
  • 89
1
2 3