GithubHelp home page GithubHelp logo

Comments (8)

tombigel avatar tombigel commented on May 24, 2024

1st - document.body works everywhere since 1992... I can't see a scenario it does not exist. 

2nd - $ assumes jquery or compatible framework, and detect-zoom is framework agnostic. 

Sent from Mailbox for iPhone

On Fri, Mar 1, 2013 at 9:10 PM, jnmichaud [email protected]
wrote:

This error causes the entire detectZoom file to fail.
I replaced document.body.style.webkitTextSizeAdjust === 'string' with $.browser.webkit === true (as I am using jquery).

Thought you should know.

Reply to this email directly or view it on GitHub:
#32

from detect-zoom.

nick4fake avatar nick4fake commented on May 24, 2024

And third - $.browser is deprecated and removed in latest jquery versions

from detect-zoom.

jnmichaud avatar jnmichaud commented on May 24, 2024

I appreciate the reply. Considering what you're doing, I think the info
about Jquery is pretty irrelevant to the situation. (The only reason I put
it in there is to demonstrate that I had to change your code and use a
bypass.)

As to document.body working or not... All I can tell you is that as of my
post, it was throwing errors in FireFox 19.0 and it stops the entire file
from loading or working so I had to do something to make it work. I'm using
the release update channel of firefox. I expect it's probably their error
and not yours, but it's doing what it's doing. What you decide to do about
that is up to you.

On Sun, Mar 3, 2013 at 6:02 AM, Bogdan Yurov [email protected]:

And third - $.browser is deprecated and removed in latest jquery versions


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-14346614
.

from detect-zoom.

tombigel avatar tombigel commented on May 24, 2024

What you are saying is pretty strange. I checked on FF 19.0 (Release
channel) and document, document.body, document.body.style are all there.

does the example on http://tombigel.github.com/detect-zoom/ work for you?

On Sun, Mar 3, 2013 at 3:23 PM, jnmichaud [email protected] wrote:

I appreciate the reply. Considering what you're doing, I think the info
about Jquery is pretty irrelevant to the situation. (The only reason I put
it in there is to demonstrate that I had to change your code and use a
bypass.)

As to document.body working or not... All I can tell you is that as of my
post, it was throwing errors in FireFox 19.0 and it stops the entire file
from loading or working so I had to do something to make it work. I'm
using
the release update channel of firefox. I expect it's probably their error
and not yours, but it's doing what it's doing. What you decide to do about
that is up to you.

On Sun, Mar 3, 2013 at 6:02 AM, Bogdan Yurov [email protected]:

And third - $.browser is deprecated and removed in latest jquery
versions


Reply to this email directly or view it on GitHub<
https://github.com/tombigel/detect-zoom/issues/32#issuecomment-14346614>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-14346882
.

from detect-zoom.

jnmichaud avatar jnmichaud commented on May 24, 2024

Yes, actually it does.

Apparently the issue is with my site and not the file.

I have no idea why that would be the case. I'll have to look into it.
(document.body is showing as null for me, on my project.)

I apologize for the mistake.

On Sun, Mar 3, 2013 at 6:38 AM, Tom [email protected] wrote:

What you are saying is pretty strange. I checked on FF 19.0 (Release
channel) and document, document.body, document.body.style are all there.

does the example on http://tombigel.github.com/detect-zoom/ work for you?

On Sun, Mar 3, 2013 at 3:23 PM, jnmichaud [email protected]
wrote:

I appreciate the reply. Considering what you're doing, I think the info
about Jquery is pretty irrelevant to the situation. (The only reason I
put
it in there is to demonstrate that I had to change your code and use a
bypass.)

As to document.body working or not... All I can tell you is that as of
my
post, it was throwing errors in FireFox 19.0 and it stops the entire
file
from loading or working so I had to do something to make it work. I'm
using
the release update channel of firefox. I expect it's probably their
error
and not yours, but it's doing what it's doing. What you decide to do
about
that is up to you.

On Sun, Mar 3, 2013 at 6:02 AM, Bogdan Yurov [email protected]:

And third - $.browser is deprecated and removed in latest jquery
versions


Reply to this email directly or view it on GitHub<
https://github.com/tombigel/detect-zoom/issues/32#issuecomment-14346614>

.


Reply to this email directly or view it on GitHub<
https://github.com/tombigel/detect-zoom/issues/32#issuecomment-14346882>
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-14347039
.

from detect-zoom.

hon2a avatar hon2a commented on May 24, 2024

The same issue is happening to me in current Chrome release (version 27.0.1453.94). The example you linked works. The difference between the two is the deployment method. Your example includes the script at the end of <body> element. Our application includes JS sources inside the <head> element.

To support this (valid) deployment method, your module shouldn't start its initialization on its own (before the document is ready). Instead, it could either expose an initialization method (which we'd call when the document is ready), or call it internally on first call of the exposed methods.

from detect-zoom.

jnmichaud avatar jnmichaud commented on May 24, 2024

Thank you. I'd assumed it was something like that (and I basically did just
that and bypassed most of the problem).

Much appreciated

On Fri, May 24, 2013 at 1:35 PM, hon2a [email protected] wrote:

The same issue is happening to me in current Chrome release (version
27.0.1453.94). The example you linked works. The difference between the two
is the deployment method. Your example includes the script at the end of
element. Our application includes JS sources inside the element.

To support this (valid) deployment method, your module shouldn't start its
initialization on its own (before the document is ready). Instead, it could
either expose an initialization method (which we'd call when the document
is ready), or call it internally on first call of the exposed methods.


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-18425357
.

from detect-zoom.

hon2a avatar hon2a commented on May 24, 2024

I'm not sure what you mean by that, but the latest commit still has the reported bug. To fix it, the detectFunction generator should be run on first use instead of on script inclusion. Like:

var detectFunction,
    selectDetectFunction = function () { /* detect function generator */ },
    initialize = function () {
        if (!detectFunction) {
            detectFunction = selectDetectFunction();
        }
    };

return {
    zoom: function () {
        initialize();
        return detectFunction().zoom;
    },
    device: function () {
        initialize();
        return detectFunction().devicePxPerCssPx;
    }
};

from detect-zoom.

Related Issues (20)

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.