hy,
I want my function run before inserting the div, I call in first my function, but it runs at the end
the first alert is displayed before the second

my function
- imagePreloader.onload = function() {
- // first alert
- alert(imagePreloader.height + " " + imagePreloader.width); ;
- };
treatment (I want to run after the function)
- //second alert
- divNew +='<div data-role="page" id="page'+ IncId +'" data-url="page'+ IncId +'">......';
- $('div#page').after(divNew).trigger('create');
how can I call my function before treatment ??