You had a unescaped "
in the onclick handler, escape it with \"
$('#contentData').append("<div class='media'><div class='media-body'><h4 class='media-heading'>" + v.Name + "</h4><p>" + v.Description + "</p><a class='btn' href='" + type + "' onclick=\"(canLaunch('" + v.LibraryItemId + " '))\">View »</a></div></div>")