views:

20

answers:

1

Hello all,

Here is my code:

$("#ddlTableType").live(
        'change',
        function() 
        { 
            $('#ddlTableCode').html('');
             var TypeID = $("#ddlTableType > option[selected]").attr("value");                
                    $.getJSON('LoadTableCodes.ashx?ObjectType=' + TypeID, function(TableCodes) {
                        alert(TableCodes);
                        $.each(TableCodes, function() {                         
                            $("#ddlTableCode").append(
                                $("<option></option>").val(this['TableCode']).html(this['TableCode']));
                        });
                    });
        }
   );

The wierd thig is that it fills the ddl but returns an error on the .append() line, saying:

Line: 168983219 Error: Object doesn't support this property or method

offcourse i don't have line 168983219 and when i am looking in the debuger it show me the append() line.

and the alert shows all the json pairs but {object:object} for all of them and not the values....mabye its that???

p.s. with jquery 1.4.2 i didn't get any response, with 1.3.2 i'm getting the result with the error....

10x for any help :-)

A: 

I've found the problem.....

Had to remove the last comma...Thats all, now every thing is great....learned something new...:-)

Erez