
img.crossOrigin = "anonymous" should be in front of img.src = path, otherwise the onload event will not be triggered on some phones(Mobile platform)

These two parts should be interchangeable, because the user may access the assets properties in the success method.