twbs / ratchet

Build mobile apps with simple HTML, CSS, and JavaScript components.
http://goratchet.com
MIT License
14.61k stars 1.45k forks source link

Unable to get push.js to work #665

Open authyrtyr opened 9 years ago

authyrtyr commented 9 years ago

Any links in my pages that should be redirecting with push.js are unresponsive. To confirm this I put data-ignore="push" in all my anchor tags and then they work just fine (albeit a little slower). The documentation at goratchet.com indicates that push.js should just intercept all my anchor tags and it doesn't look like I have to do much of anything extra beyond making sure that all the pages involved follow the basic template for a ratchet page. Is there something that I'm missing?

wukonggege commented 9 years ago

I have found the same problem

sensecall commented 9 years ago

Not sure if this helps, but I think it is because push.js only accepts touch events, not clicks.

I was having the same issue and running using the device emulator in Chrome worked.

authyrtyr commented 9 years ago

I was using ios-sim which supports touch events. Push.js starts working if I deploy to a physical device but I have no idea why it doesn't work in the simulator.

helloworlder commented 9 years ago

Doesn't work on physical device either, for me. I ended up bypassing push.js all together. Which brought me to #683.

flowte commented 9 years ago

having this issue too. I can run the demo sites fine, the touch events work but when I try running it on my site it doesn't. Are there any required ports that should be opened or anything else on the server that could cause an issue like this?

cameronehrlich commented 9 years ago

You need to use something like Fingerblast.js to simulate touch events on non touch enabled devices.

authyrtyr commented 9 years ago

I was using a touch enabled simulator. Other touch based events are working.

jackniu81 commented 9 years ago

And can we say, ratchet is a 'mobile only' framework if it not support PC browsers?

Mithgol commented 9 years ago

If the Android device has a USB OTG port, a USB mouse can be attached to the device using a microUSB-to-USB connector such as the following:

a microUSB-to-USB connector

Should push.js (and therefore Ratchet) support clicks of such a mouse? Or are they automatically converted to touch events by the system (Android)?

trevor403 commented 8 years ago

It's very easy to convert clicks to touches and vise versa in javascript, and since this is a moble targeted app, specifically targets at the iPhone UI, there is no reason for push.js to fire on click. If your website will not be used on mobile you can change touchend in push.js to click