Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Outputting div
- <div class="postButtons pw-server-widget" data-id="wid-oq19btvv"></div>
- // Post's JS is included with PHP, but here's the jist of it:
- $js = <<<JS
- (function () {
- var s = document.createElement("script");
- s.type = "text/javascript";
- s.async = true;
- s.src = ('https:' == document.location.protocol ? 'https://s' : 'http://i')
- + '.po.st/static/v4/post-widget.js#publisherKey=$pub_key';
- var x = document.getElementsByTagName("script")[0];
- x.parentNode.insertBefore(s,x);
- })();
- JS;
- // This is just me testing out some of the JS methods, is this on the right track?
- // The setTimeout is just for testing.
- setTimeout(function () {
- window.postPlatform.init('.pw-server-widget');
- console.log(window.postPlatform, 'window.postPlatform');
- }, 2000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement