Giter VIP home page Giter VIP logo

device.js's People

Contributors

borismus avatar dominikguzei avatar matthewrobertson avatar pioupioum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

device.js's Issues

querySelectorAll is not supported in IE<8

Very nice lib, thanks!

I did encounter the problem that document.querySelectorAll does not exist in IE versions before IE8, thus it throws an error. Since basically I don't care about redirecting a browser that doesn't support this, I wrapped the entire code in if(document.querySelectorAll){ ... }

Preference Cookie?

Nice solution.

But it is not ideal if we want to let the user stay on the desktop website after using the force=1 GET parameter. (Many users like to browse the desktop version of a website even if displayed on a mobile device.)

You may want to consider creating a "preference cookie" when that parameter is used.

In such a scenario, the desktop website can offer a link to the mobile version if our user wants to go back to that version.

Info about SEO and different devices/media queries from Google?

Is there any Google Advice / Best practise (like here about multilanguage content: http://support.google.com/webmasters/bin/topic.py?hl=en&topic=2370587&parent=2371375&ctx=topic ), but devoted to 'multidevice' topic? I'm really interested how to say Google "Here is my content, but i also have optimized one for mobile, tablets and others X-width devices".

Putting content just like that on m.foo.com or tablet.foo.com won't be treated as a duplicate?

PS: I know it is not an issue, but You can always mention it in Your readme file. Somewhere near: "You may also want to distinguish between these different versions by providing separate URLs (eg. tablet.foo.com, m.foo.com and foo.com) for clarity and perhaps for SEO reasons."

Hide ?force=1 in the URL using History API

Device.js lets you force loading the exact version of the app to load through the combination of ?device=deviceClassId and ?force=1 GET parameters. However, these could be hidden to give a cleaner URL.

tests are failing

Looks like perhaps some tests from a different project were accidentally checked into this project?

Error when using media query "orientation: landscape"

Hi!
I have started using your repository to switch between a desktop (orientation: landscape) and mobile (orientation: portrait) versions of a website. However, when using these orientation media queries, I was getting errors that I traced to the parsing of the media query in MQParser.prototype.parse in the file device.js. Apparently, using and as the criteria to split up the elements of a media query did not take into account that and is included in the word landscape. I developed a simple workaround to replace landscape with a dummy word, and I substituted landscape back again after the query was parsed. However, you may want to update the code to handle this situation in a more elegant manner. Thanks for developing this very useful capability!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.