Skip to content

Correct load() function for jquery 3.1.1 #15

@centurianii

Description

@centurianii

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions