Using a form or specifics links, I can update the content of the div "mydiv" using an Ajax request (mootools 1.2) (var myRequest = new Request({...). The "imported" content looks like:
<div id="div1">...</div><div id="div2">...</div>...
Once my ajax call is done and completed (content of "mydiv" is replaced as expected) I would like to change some css properties of this "imported content (ie. add a top margin to div2). I tried to add to onComplete: function(response) { $('div1').setStyle('margin-top', '50px'); alert('Request completed successfully.'); }
Nothing occurs but javascript error telling that element div1 is null. Am I missing something here or what should I do in order to be able to manipulate the "imported" data? Thanks in advance for your help. BM