Comunidad de diseño web y desarrollo en internet online

Error con plugin de jQuery propio, funciona en chrome pero no en IE

Citar            
MensajeEscrito el 10 Abr 2012 11:50 pm
Saludos, he escrito este plugin (si merece llamarse asi):

Perdón por copiar el código completo, pero no tengo idea de donde este el error, la consola regresa esto:

Esto funciona bien en chrome pero no en IE6, IE7, IE8 e IE9.
Saludos.

Gracias de antemano.

/plcarrusel/:30Script listo
plcarrusel.js:7plcarrusel: Iniciando
plcarrusel.js:21plcarrusel: Iniciando carga de XML
jQuery.js:4XHR finished loading: "http://tvecorp.tv/plcarrusel/mixml.xml".
plcarrusel.js:25plcarrusel: Carga de XML correcta
plcarrusel.js:87plcarrusel: Ancho total de la lista 660 ancho del contenedor 480
plcarrusel.js:90plcarrusel: La lista es mas grande que el contenedor
jQuery.js:4GET http://mipagina/plcarrusel/undefined 404 (Not Found)
f.extend.cleanjQuery.js:4
f.buildFragmentjQuery.js:4
f.fn.extend.domManipjQuery.js:4
f.fn.extend.appendjQuery.js:3
$.fn.extend.plcarrusel.elementosplcarrusel.js:36
e.extend.eachjQuery.js:2
e.fn.e.eachjQuery.js:2
ccrsplcarrusel.js:28
$.fn.extend.plcarrusel.$.ajax.successplcarrusel.js:22
f.Callbacks.ojQuery.js:2
f.Callbacks.p.fireWithjQuery.js:2
wjQuery.js:4
f.support.ajax.f.ajaxTransport.send.djQuery.js:4



Código Javascript :

(function($){
$.fn.extend({
plcarrusel: function(){
   console.log("plcarrusel: Iniciando");
   var elem=this;
   $(this).attr("id","plcarrusel");
   var opciones=arguments[0] || {};
   
   var alto=opciones.alto || "100px";
   var ancho=opciones.ancho || "480px";
   alem=opciones.alem || "50px";
   anem=opciones.anem || "50px";
   var xml=opciones.xml || "mixml.xml";
   var desc=opciones.desc || true;
   $.ajax({
       url:xml,
       dataType: "xml",
       beforeSend: function(){console.log("plcarrusel: Iniciando carga de XML");},
       success: function(datos){ccrs(datos, elem, ancho);}
   });
   function ccrs(xml, elem, w){
   console.log("plcarrusel: Carga de XML correcta");
   texto="<img id='btnizq' src='fli.png'/><div id='plvi'><div id='pldesp'></div></div><img id='btnder' src='fld.png'/>"
   $(elem).append(texto);
   $(xml).find("evento").each(function () {
       var nombre = $(this).attr('nombre');
       var streamer = $(this).attr('streamer');
      var file = $(this).attr('file');
      var img = $(this).attr('img');
      var desc = $(this).attr('desc');
      
      var texto="<div class='elem'><img class='imgelem' src='"+img+"'/><input type='hidden' value='"+streamer+"' class='streamer'/><input type='hidden' value='"+file+"' class='arch'/><div id='descelem'><b>"+nombre+"</b><br/>"+desc+"</div></div>";
       $("#pldesp").append(texto);
       });
      var elementos=$(xml).find("evento").length;
      ccarrusel(elementos, w);
      var file=$(".arch").eq(0).val();
      var streamer=$(".streamer").eq(0).val();
      jwplayer().load({
         streamer: streamer,
         file: file
      });
      $(".elem").eq(0).animate({
            backgroundColor:"#CCC",
      }, 100);
      var act=0;
      $(".elem").mouseover(function(){
         if($(this).index(".elem")!=act){
         $(this).animate({
         backgroundColor:"#CCC",
         }, 100);
         }
      });
      $(".elem").mouseout(function(){
         if($(this).index(".elem")!=act){
         $(this).animate({
         backgroundColor:"#999",
         }, 100);
         }
      });
      $(".elem").click(function(){
         var i=$(this).index(".elem");
         var file=$(".arch").eq(i).val();
         var streamer=$(".streamer").eq(i).val();
         act=i;
         jwplayer().load({
            streamer: streamer,
            file: file
         });
         $(".elem").each(function(){
            $(this).animate({
            backgroundColor:"#999",
         }, 100);
         });
         $(this).animate({
            backgroundColor:"#CCC",
         }, 100);
      });
}

function ccarrusel(elementos, ancho){
   var medida=(elementos*110);
   var ar=parseFloat(ancho);
   console.log("plcarrusel: Ancho total de la lista "+medida+" ancho del contenedor "+ar);
   if(medida>ar){
      $("#pldesp").width(medida);
      console.log("plcarrusel: La lista es mas grande que el contenedor");
      var pos=$("#pldesp").position();
      var x=0;
      var mn=(medida*-1)+110;
      var mp=medida-110;
      $("#btnder").click(function(){
         console.log("plcarrusel: btnder click")
         if((medida+x)>=mp){
         $("#pldesp").animate({
            left:x-110,
            })
         x=x-110;
         }
         });
      $("#btnizq").click(function(){
         console.log("plcarrusel: btnizq click");
         if((x+110)<=0){
         $("#pldesp").animate({
            left:x+110,
            })
         x=x+110;
         }
         });
      }
   }
   
   }
})
})(jQuery);

Por cranecx

21 de clabLevel



Genero:Masculino  

Desarrollador Web

chrome
Citar            
MensajeEscrito el 13 Abr 2012 12:46 pm
Al parecer el error es al intentar obtener un archivo que no existe...

Y no existe porque la variable que intenta obtener no está definida...

veo que usas jwplayer. Tienes todos los archivos del plugin y en el lugar correcto?

Estas seguro que eso está funcionando...

A vista rápida no veo nada más raro.

Por nax_hh

Claber

168 de clabLevel

1 tutorial

 

Reus

chrome

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.