This project has moved. For the latest updates, please go here.

My results are varying ...

Aug 14, 2011 at 8:09 PM

I just came across this library and thought I would see if there were advantages to using it. 

I have an AJAX web service [OperationContract] that returns a list of files; FileInfo[].  In my jQuery code, the following works:

for (i = 0; i < data.d.length; i++) {
  $("<li></li").html("<b>" + data.d[i].OriginalPath + "</b>").appendTo("#files");

The data.d.length returns 2 because there are 2 files in d (in the path itself). 

FileInfo[] files = Directory.GetFiles("@c:\");
return JsonConvert(files);
When I use the code above in my web service, and use the same javascript code as above, data.d.length returns the length of the string d.  Not that there are 2 elements.  

Is this normal behavior? 

thank you!