Can't access DOM elements in AJAX success function
I cant access DOM elements by ID in the Success function of an Ajax call. Here's the HTML (snippet) :
<div id="columns">
<ul id="column1" class="column ui-sortable"/>
<ul id="column2" class="column ui-sortable">
<li id="weather.ascx" class="widget">
</li>
<li id="inbox.ascx" class="widget">
</li>
</ul>
<ul id="column3" class="column ui-sortable"/>
</div>
Here's the AJAX call :
$.ajax({
type: "POST",
url: "test.aspx/addWidget",
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
var widget = "";
$('#column2').append(msg.d);
alert($("#inbox.ascx").ID);
},
error: function(xhr,msg,e){
alert(msg);//Error Callback
}
});
I can access the element returned by the call using a class selector (.widget) but not directly by and ID, and I only want to manipulate the single element not mutiple elements.
Anybody had a similar porble ? Did post last night similar Q and was directed to putting everything in the success function, which i've doen but still not working . Help ???????