ellisonleao / sharer.js

:on: :bookmark: Create your own social share buttons. No jquery.
http://ellisonleao.github.io/sharer.js
MIT License
2.02k stars 198 forks source link

Without npm #252

Closed ctuxboy closed 1 year ago

ctuxboy commented 1 year ago

i don't have npm. Is there a.way using this buttons on my website without using npm? Maybe manual with vanilla Javascript?

ellisonleao commented 1 year ago

hey @ctuxboy the script doesn't require npm to be used. Just load it using a CDN and add the data-* tags in your element. for example:

<-- import it -->
<script src="https://cdn.jsdelivr.net/npm/sharer.js@latest/sharer.min.js"></script>

<-- use it, twitter example-->
<button class="button" data-sharer="twitter" data-title="Checkout Sharer.js!" data-hashtags="awesome, sharer.js" data-url="https://ellisonleao.github.io/sharer.js/">Share on Twitter</button>
ctuxboy commented 1 year ago

hey @ctuxboy the script doesn't require npm to be used. Just load it using a CDN and add the data-* tags in your element. for example:

<-- import it -->
<script src="https://cdn.jsdelivr.net/npm/sharer.js@latest/sharer.min.js"></script>

<-- use it, twitter example-->
<button class="button" data-sharer="twitter" data-title="Checkout Sharer.js!" data-hashtags="awesome, sharer.js" data-url="https://ellisonleao.github.io/sharer.js/">Share on Twitter</button>

Wow! That's nice, i will try this! Thanks a lot for the fast reply :ok_hand: