faield to load svg from wix gallery manager from #html

  1. trying to load a vector image and effect it in html

  2. in html script code:

  3. var img = document.createElement(“svg”);

  4. debugger;

  5. img.src=“wix:vector://v1/d711240adb10476eaeefaddb15f0a01a.svg/d711240adb10476eaeefaddb15f0a01a.svg”;

  6. this is the src of this vectore.

  7. the error i get:

  8. Uncaught SyntaxError: Invalid or unexpected token

  9. the “wix:vector://”

  10. in documentation is writtrn to accese like this?

  11. i need to controll the object

  12. img.style.left=“500px”; etc…

Wix is unable to rescale an object through html on the page itself.
A solution would be to use a iframe and simply load the svg and said changes in the html code in there which also allow you to communicate different values etc. though again, you are unable to change the iframe size itself at runtime.
You have to decide on a size and stick with it until Wix become more responsive.

You could set an area off on the page and use iframe or the new content window (beta so not sure you have access to that) that way you can change the image size itself but if it become larger than the iframe itself scroll bars or cutoffs will happen.

Hope this helps a bit

You’re writing in HTML, so the Wix documentation you’re referring to doesn’t apply. If you were using Corvid then Wix would translate the URL you’ve reproduced here to a standard http URL but since you’re outside of Corvid you have to do it yourself.

https://www.wix.com/corvid/reference/wix-media-backend.mediaManager.html

The above functions should give you a rigorous method of retrieving the correct public URL but it might also be possible to do simple string manipulation once you understand the scheme used to build these URLs.

If it’s just one or a handful of images that will remain the same, you needn’t worry about any of this.

https://support.wix.com/en/article/retrieving-the-url-of-an-image