Open xel23 opened 5 years ago
I have similar issue. I get error that says setLocationHref
is not a function. By logging, it seems like it's a part of Lottie, not anim which are stated in documentation.
@xel23 can you share a link with an example?
@bodymovin try the same page with a different url parameters.
Works fine:
https://xel23.github.io/playground/?query=test
Doesn't work:
https://xel23.github.io/playground/?query=test(
https://xel23.github.io/playground/?query=test)
Not sure if this is related to the lottie library. Seems more of a general path issue. Can you try with a static svg using that url?
I've investigated reason of this problem.
setLocationHref
is used for setting variable locationHref
, so when we try to pass locationHref
in css function url()
we should escape (
and )
if we have them in argument which is passed in url()
.
I've prepared solution for this issue in pull request #1889
@bodymovin Could you please check?
@bodymovin the problem in the code like this:
Because there are using unquoted URI notation for url
we should escape some characters in URI. In our case, we should escape parentheses.
https://www.w3.org/TR/CSS2/syndata.html#uri
li { list-style: url(http://www.example.com/redball.png) disc } Some characters appearing in an unquoted URI, such as parentheses, white space characters, single quotes (') and double quotes ("), must be escaped with a backslash so that the resulting URI value is a URI token: '(', ')'.
@xel23 provided a solution with escaping parentheses but I think it's better to use a quoted notation for url
and use encodeURI
to escape not valid characters in URI.
Hello!
I have problem with setLocationHref. I use setLocationHref for supporting animation in safari, but if I pass path which contains parenthesis "(" or ")", setLocationHref doesn't work as expected and animation starts glitching in any browsers.