0

Using a simple JQuery ajax request how would I calculate the response size of the xml object that is being returned from my webserver? Is there a specific JQuery byte size method or could I simply use the .length method with a basic maths calculation, for instance:

resultSize = (xmlObject.length / 1024); 

Any help/suggestions would be appreciated.

7
  • Is requirement to return byte size of resource before request?, during request ? Commented Mar 18, 2015 at 7:58
  • I would just like to calculate the returned data in the ajax method. I think my calculation does work, for instance the default success: function(data, status, xhr) method. If I use the data object like: (data.length / 1024) this gives me a value in KB. Im just not sure if there is a better way to do this. Commented Mar 18, 2015 at 8:00
  • What is application ? Commented Mar 18, 2015 at 8:01
  • html web page with jquery. Commented Mar 18, 2015 at 8:23
  • What is application of returning response byte size ? Is requirement to return byte size of resource only ? or, perform a task with returned byte size of resource ? Commented Mar 18, 2015 at 8:27

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.