Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct load() function for jquery 3.1.1 #15

Open
centurianii opened this issue May 8, 2019 · 1 comment
Open

Correct load() function for jquery 3.1.1 #15

centurianii opened this issue May 8, 2019 · 1 comment

Comments

@centurianii
Copy link

I was wondering why it is working on the one test page and not on the other when I noticed that error was coming from line 325, so here is the amendement for jquery 3.1.1. as load() is deprecated (see jquey page)

that

324:        img1 = new Image();
        $(img1).load(function () {
            ctx.init2(this, 0);
        });
        img1.src = sImg.attr('src');

        img2 = new Image();
        $(img2).load(function () {
            ctx.init2(this, 1);
        });
        img2.src = jWin.attr('href');

replace with this:

        img1 = new Image();
        $(img1).on('load', function () {
            ctx.init2(this, 0);
        });
        img1.src = sImg.attr('src');

        img2 = new Image();
        $(img2).on('load', function () {
            ctx.init2(this, 1);
        });
        img2.src = jWin.attr('href');

I also replaced variable ctx with that; I suppose ctx means context but it's too generalized.

@centurianii
Copy link
Author

I also replaced all unbind with off and all bind with on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant