Closed deepakkashyap3013 closed 3 years ago
Hi, can you clarify what you mean by dynamic endpoints?
For eg : data-url="https://dapplooker.com/integration/" this is working fine but if i add a variable end point like data-url="https://dapplooker.com/integration/{{variable}}" in this case the url shown in the twitter is the current page url not the intended one
if i add a variable end point like
data-url="https://dapplooker.com/integration/{{variable}}"
Do you use some sort of framework? shareon is not optimized for such use, yet supports it.
shareon only updates the buttons once. After the page is loaded, it searches for all .shareon
containers and updates the href
(or onclick
) parameters. If the data-
attributes are then changed, shareon doesn't see it. To manually update it, you need to call the shareon()
function. It is exported when you import "shareon"
or, if you use the browser link, is available as window.shareon()
. See first code snippet in Initialization for reference.
In your case, I believe you need to add some sort of hook to update the URLs via shareon()
each time the variable changes value
Thanks for sharing this :)
Whenever I am passing a URL with dynamic endpoints it is taking the current page url . How to use dynamic urls in the data-url attribute ?