views:

23

answers:

2
new Ajax.Request('Handler.ashx',
            {
                method: 'get',
                onSuccess: function(transport)
                {
                    var response = transport.responseText || "no response text";
                    //alert("Success! \n\n" + response);
                    var obj = response.evalJSON(true);
                    alert(obj[0].Nam);
                    alert(obj[0].IM);
                    for(i = 0; i < 4; i++)
                    {
                        $('MyDiv').insert(   new Element('checkbox', { 'id': "Img" + obj[i].Nam, 'value': obj[i].IM }) );
                        return ($('MyDiv').innerHTML);
                    }


                },
                onFailure: function() { alert('Something went wrong...') }
            });
A: 

checkbox is not valid tag name. Are you trying to create <input type="checkbox" />?

new Element('input', { type: 'checkbox', ... })

Also, it makes no sense to call return in onSuccess callback function.

jholster
A: 

thnx yaggo!! i really appreciate but i got one more question like i wanna disply check box and imgae both together

vicky