Get height and width of ajax response
I have a script which sends an ajax request and the appends the data to a div which needs to change it's height and width depending on the content returned.
So far I have
- $.ajax({
- url: url,
- success: function(data) {
- target.html(data);
-
- var contentWidth = target.width();
- var contentHeight = target.height();
-
- alert(contentWidth + ', ' + contentHeight);
- }
- });
However this doesn't return the new width and height it just returns the previously set css values.
Does anyone know how to acheive this?
Thanks for any help