in my page i am calling a controller using $.get with some parameters ,
that controller returns me a view page (.aspx), now, i bind that page to a different div every time as this function can be iterated (or called multiple times) these div s are already created and then result is mapped to each div
function getview(Name, Parameters, Target) {
$.get('Home/Submit',
{ Name: name,
Parameters: Parameters
},
function(result) {
$("#" + Target).html(result);
//alert("something");
});
}
this method is called as:
<div id="{{'_Temp' + Id}}">{{getAction('_AddToFavorite', 'ContentId,'
+ Id + ',Version,' + Version + ','li_ContentFavorites_Temp'
+ Id)}} </div>
Now what happens here is the html gets bind to respective div but only when that 'alert()' is there otherwise the view page gets bind randomly (ie sometime it does sometimes it doesn't) but for last iteration it does.
*I think * that this is because before the data is actually bind to the respective div the next data(viewpage) comes in.
is there any way to make process stop (or delay) so to bind data properly.