This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Why ('ontouchstart' in window) is false on a touch tablet with Windows 8

  • 3 replies
  • 3 have this problem
  • 5 views
  • Last reply by RodiBenov

more options

I use Java Script to determine if my Web-Site is running on Tablet touch device The device is Assus tablet with windows 8

I use Java Script to determine if my Web-Site is running on Tablet touch device The device is Assus tablet with windows 8

Chosen solution

Are you assuming that the return value is false because it is not true? According to this, null is sometimes returned instead of true. If false is actually returned, then I would think it is a fault with the tablet's browser. Either that or in the browser's settings there are options to pretend the device is something else (for testing purposes); there is no reason why these should be selected by default though.

If that's no help then please give us further details (such as the browser you are using).

Read this answer in context 👍 0

All Replies (3)

more options

Chosen Solution

Are you assuming that the return value is false because it is not true? According to this, null is sometimes returned instead of true. If false is actually returned, then I would think it is a fault with the tablet's browser. Either that or in the browser's settings there are options to pretend the device is something else (for testing purposes); there is no reason why these should be selected by default though.

If that's no help then please give us further details (such as the browser you are using).

more options

I solved my problem setting dom.w3c_touch_events.enabled to 0

more options

Sorry I mean setting dom.w3c_touch_events.enabled to 1