Ciao a tutti,
vi scrivo per un problema che non riesco a superare da un paio di giorni, se faccio girare questo script su jsfiddle non ho problemi a reperire l'attributo link dall'elemento della lista mentre quando lo faccio girare su joomla mi restituisce: Uncaught TypeError: Object #<HTMLLIElement> has no method 'data'
Versione di Joomla! Joomla! 3.2.2 Stable [ Ember ] 6-February-2014 16:00 GMT
Versione piattaforma Joomla! Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
secondo voi di cosa si tratta?
ecco l'html:
<div class="wrapplayer">
<ul>
<li class="video1" data-link="URL_DEL_FILE"><input type="button" value="load video" />
</li>
</ul>
<>
e ora lo script jquery incriminato:
jQuery('li[class="video1"]').click(function() {
// alert("click!");
//alert($(this).outerHTML);
alert($(this).data('link')); // questo alert non funziona sulla piattaforma joomla ma su jsfiddle sì!
return;
var $target = $(this).attr("rel");
var $vid_obj = _V_("div_video");
$vid_obj.ready(function() {
// hide the video UI
$("#div_video_html5_api").hide();
// and stop it from playing
$vid_obj.pause();
// assign the targeted videos to the source nodes
$("video:nth-child(1)").attr("src",$target);
// reset the UI states
$("#div_video").removeClass("vjs-playing").addClass("vjs-paused");
// load the new sources
$vid_obj.load();
$("#div_video_html5_api").show();
});
});