Created
April 21, 2020 14:51
-
-
Save fielding/4658bbaa0e09d28f56b2a4cca224d581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPageName(url) { | |
var index = url.lastIndexOf("/") + 1; | |
var filenameWithExtension = url.substr(index); | |
var filename = filenameWithExtension.split(".")[0]; | |
return filename; | |
} | |
var url = window.location.href; | |
var fileName = getPageName(url); | |
var vidy = new Vidy({ | |
appid: 'YOUR_APP_ID_HERE', | |
postid: filename, | |
content: '.className' OR '#elementID', | |
autoload: true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment