I want to add some HTML to the end of every youtube link to open up the player in a litebox. This is my code so far:
$(document).ready(function() {
var val
The reason is that open_litebox()
is declared inside the document.ready
function, and therefore not accessible from a global scope.
You can move the function outside of document.ready
, or, modify the code to attach the onclick handler using jQuery (which references the function directly):
var link = $('
' ).click(function () {
open_litebox('hi');
});
$(this).after(link);