How to load image from external website into game using Javascript?

I tried some codes from posts here: https://gist.github.com/derofim/b118a47af0022e3c9c57, Cocos2d-js 3.6.1 Load image from URL, [SOLVED] Load external sprites from an URL and Load Image via URL but no luck they all returned error messages.

Error messages like “Sorry, cc.Sprite.textureLoaded is removed.”, “Uncaught TypeError: sp.initWithTexture is not a function”, “Sorry, cc.loader.loadImg is removed, please use load instead.” appear.

How to load an image from a website in cc.Class using Javascript?

Thanks in advance.