Why doesn't this work? jquery javascript

Posted by mars on Stack Overflow See other posts from Stack Overflow or by mars
Published on 2010-05-12T08:47:00Z Indexed on 2010/05/12 8:54 UTC
Read the original article Hit count: 216

Filed under:
|
|
$(document).ready(function() {
        musicList = new array()
        counter = 0;

        if($(".rA, .trA, .dA, .hA").length > 0)
        {

            /*$(".rA, .trA, .dA, .hA").each(function(e){*/
            $(".hA").each(function(e){

                $.post("/index/audio/ajax.track", { id: $(this).attr("rel") },
                   function(data){




                                  /*THIS DOESN'NT WORK */
                    musicList.push(data.file);
                                  /*THIS DOESN'NT WORK */
                    alert(data.file);/*this words*/
                   }, "json");

                counter++;

            });

            if(counter>0)
            {
                alert(counter);
            }
        }


});

I don't see anything wrong with the code but I have no idea why it won't work I just spent 3 hours trying to get it to work

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery