0
People in this google script have a comment written "Add code to Handle subscribe Event." translating "Add code to handle signature event.".
I want to know if there is a way I can put a code in this place so that when the "subcribe" action occurs the button disappears. If there’s a way and you know the code, you can give it to me?
<script src="https://apis.google.com/js/platform.js"></script>
<script>
function onYtEvent(payload) {
if (payload.eventType == 'subscribe') {
// Add code to handle subscribe event.
} else if (payload.eventType == 'unsubscribe') {
// Add code to handle unsubscribe event.
}
if (window.console) { // for debugging only
window.console.log('YT event: ', payload);
}
}
</script>
<div class="g-ytsubscribe" data-channel="GoogleDevelopers" data-layout="default" data-count="default" data-onytevent="onYtEvent"></div>
If Voce can edit the code/div of the button put one
id
in it and hide in the subscribe if. If the button is being automatically generated it is a little different. And what is this api that is using?– Neuber Oliveira
Google Developers
– Márcio Sebastião
https://developers.google.com/youtube/youtube_subscribe_button?hl=pt-br
– Márcio Sebastião
is using jquery too?
– Neuber Oliveira
No, only html and js
– Márcio Sebastião