Comments (9)
Let me see if I understood your question. You replaced the old socialshare-privacy code with Shariff.
The socialshare-privacy documentation recommended using the script tag inside the <head>
of your document.
In contrast to that, Shariff must be included right before the (closing) </body>
tag to work. Have you followed that instruction?
from shariff.
Yes,
if I would have an <div class="shariff"></div>
it would work that way.
My problem is,
- that the html-code has no class="shariff", i have an id=socialshare
- I want enable the Share-Buttons later, not at body-end, but only after dom-ready
Solution could be:
- on dom-ready I add with javascript the class=shariff to my div-with-id
Now comes problem 2 - dom-ready ist later then body-end, I now want to trigger the shariff-code later, or better I want to give my $('#socialshare') as object to Shariff to paint the share-buttons there
from shariff.
Embedding Shariff is difficult in your situation (not a node project, no .shariff
element).
Try something like this:
<head>
$(function() {
$("#socialshare").addClass("shariff");
$.getScript("/path/to/shariff.js");
});
</head>
In my opinion modifying the HTML document is the best option.
from shariff.
We had a problem using this too recently. Our project was also not a node project.
We had need to initialize the shariff code after it was loaded on to the page, to allow for later ajax'd content to include the sharing functionality. The way we fixed this was to assign the _Shariff function to the window object. This allowed us to call as and when we needed.
Is this something you could add to this project to allow the plugin to be used in this way as well?
from shariff.
Just pushed a change that renames _Shariff
to Shariff
and that exports the Shariff
class to the global
(window
) object:
27cd300#diff-f9e06b21d8f4ff0e3fd8301ee954ec47R236
This example html page shows how to initialize shariff after it was loaded:
https://github.com/heiseonline/shariff/blob/master/demo/custom-initialization.html
The change is not released yet.
from shariff.
Looks great. Any idea when this might be released?
from shariff.
Today or tomorrow.
from shariff.
Perfect. Thanks for the update.
from shariff.
Just released v1.9.1.
from shariff.
Related Issues (20)
- viber.com inclusion request HOT 1
- Fix LinkedIn Sharer-URL to 2020 Version HOT 1
- WhatsApp: Support for WhatsApp Web via wa.me (api.whatsapp.com) HOT 2
- Why is there no service for WeChat? HOT 2
- Add {title} replacement to mailBody
- last release 18month ago: plz show life -and integrate some pull requests HOT 8
- Its not a good idea to overwrite the native javascript scrollTo() function
- Mastadon button HOT 1
- Error in WP 5.5: “register_rest_route was called incorrectly” HOT 1
- Problem with Infinite Ajax Scroll
- Error in the documentation for data-services HOT 1
- Flattr responds with 404
- Repo still active? HOT 2
- Enable Hashtags for content
- Image inclusion in FB posts HOT 1
- RFC: Button for "clipboard" service misleading icon and title?
- Change Twitter Icon HOT 3
- Bluesky
- Add MeWe, Mix, send by SMS, wallabag
- Twitter still Twitter and a bird symbol - fix in comments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shariff.