im having some weird problems with this arrays, what im trying to do first of all is compare two dates within a map array and if its true then i will append it to the container , if its false it wont do anything , but for some reason it does append the div but not the img with the value ;( , if i alert the variable is in there but it doesnt work within the image tag.
So heres what im doing:
var sabiasfechas = {
'2012-01-02': '2012-12-02',
'2012-01-02': '2012-12-02'
}
sabiasfotos=new Array(2);
sabiasfotos[0] ='sabias1.jpg';
sabiasfotos[1] ='promo-tablet.jpg';
$.each(sabiasfechas,function(key,value){
$.each(sabiasfotos,function(otrovalue){
var fechainisab = Date.parse(key);
var fechafinalsab = Date.parse(value);
var fechainicomsab = Date.today().compareTo(fechainisab);
var fechafincomsab = Date.today().compareTo(fechafinalsab);
if(fechainicomsab == 1 && fechafincomsab == -1){
$("#imagenescontent").append("<div class='sombra'><img src='img/" + this+ "'/></div>");
}
else{
console.log("nada")
}
})
})
Any ideas?
Edit: I forgot to close the img tag LOL tnx btw.
you have no closing ‘ at the end of your src attribute