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

Use cached pages with Ratchet (Push.js)

I'm developing an hybrid app and I'm using Ratchet for that. On the first page (index.html) the app retrieves content dynamically and adds that content via jQuery to the DOM. When I navigate to another tab (sub-page), and navigate back to the main…
John Brunner
  • 2,842
  • 11
  • 44
  • 85
1
vote
0 answers

Sending RegistrationID to Push Server (With a UserID)

I am trying to set up a push notification server, I have gotten the plugin working in my cordova application and I am trying to implement something that sends an ID and the app Registration ID. I am doing this buy placing the user ID within a…
geolaw
  • 412
  • 1
  • 12
  • 26
1
vote
2 answers

Ajax request without push.js

I'm using Ratchet 2 to build an app. I'm trying to make a simple ajax call and get the response like so function tryLogin() { var hxr; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else { xhr = new…
pistou
  • 2,799
  • 5
  • 33
  • 60
1
vote
2 answers

Ratchet remove/add data-ignore="push"

Using ratchet framework, I am able to slidein/slideout of any pages, I arrive on a situation where I have to get the data first before it slides to the next page. I can get the data but the slide transition of the page is gone. Is there a way to do…
meetmahpuppy
  • 418
  • 1
  • 4
  • 17
1
vote
0 answers

ratchet.js and push.js on phonegap application with backbone routing

I would like to use push.js for simulate a native transition on my phonegap application. I use backbone.js, zepto.js, ratchet.js, push.js no working when i change page. main.js: require.config({ paths: { jquery:…
Flavio Bontà
  • 164
  • 1
  • 13
0
votes
0 answers

PushJS does not open link when click in notification

Using PushJS libary to use Push Notifications, when I add link option A relative URL path to navigate to when the user clicks on the notification on mobile (e.g. if you want users to navigate to your page http://example.com/page, then the relative…
Shinomoto Asakura
  • 1,473
  • 7
  • 25
  • 45
0
votes
1 answer

Uncaught ReferenceError: module is not defined at push.js

I am developing an Android App using Phonegap and trying to add the Push Notification. I already added the plugin successfully using "phonegap plugin add phonegap-plugin-push". Config.xml was also updated and i can see the version of push plugin as…
lotzkie
  • 1
  • 3
0
votes
0 answers

Error using push.js in vb.net

I'm trying to make some browser notifications with push.js library and vb.net The notification works but my problem is I want multiple notifications at same time, if I need it. the data is taken from my database and usually it'll be more than one…
krlosruiz
  • 113
  • 3
  • 11
0
votes
2 answers

Ignoring a form submit with Push.js and Ratchet

I am using Ratchet for creating a mobile web page using ASP .NET MVC and I am loving it. I also love using push.js. However, I want to ignore a form submission and do a little extra content updating without the navigation. However, no matter what…
Jamie
  • 3,094
  • 1
  • 18
  • 28
0
votes
1 answer

How to pass data and variables to new page with Push.js

I'm currently develop an hybrid app with the Ratchet framework. Within this framework, all links are loaded via Ajax with the Push.js file. Everything works fine for static pages, but how can I retrieve a page which is dynamically generated? How can…
John Brunner
  • 2,842
  • 11
  • 44
  • 85
0
votes
1 answer

Ratchet push.js failing to redirect webpages

I'm trying to create a simple Cordova mobile app using Ratchet and am unable to get push.js to load any pages. The only thing that my research pulled up is that the push event only works on mobile devices but I'm not using it in the browser. I've…
Jesse Green
  • 373
  • 2
  • 6
  • 20
0
votes
0 answers

Keyboard taking to hidden model form

When click on input the key board shows next option to reach hidden form, and also able to type something and it will appear when open the model. The issue is that I can type in to the model form without opening it
Mo.
  • 26,306
  • 36
  • 159
  • 225
0
votes
3 answers

nav-bar element disappears when using data-transition and push.js

I'm using Ratchet to build a prototype for a mobile app. I have a element in page A and page B. When using data-transition from page A to page B (using push.js), the element disappears. Another…
0
votes
1 answer

Push doesn't work (Error: Could not get)

Trying to use Ratchet's push.js, but doesn't work. What I have in console: [Error] Error: Could not get: file:///var/mobile/Applications/337585D8-89E1-4810-AB37-0A6DD2DA3A34/Gustav.app/www/booking.html failure (ratchet.js, line…
0
votes
2 answers

Ratchet's push.js form submit reloads page, messes up push.js replacing div

I am developing a web application with ratchet.js (and their push.js) and have a very basic problem. My CSS code positions elements in one page in three columns. The user then can click on a navigation bar button to goto the next page. Once in the…
Darth Maul
  • 84
  • 8