[jQuery] Comparison of getJSON and ajax

Comparison of jQuery getJSON and ajax.

I tried to debug this code in jQuery(the following), the object is to get the data from a json file and re-format the output data into an array, this array will be used in others functions later.

$(document).ready(function() {
  var arr = [];
  // Get data from a json file
  $.getJSON("jsonfile.json", {}, function(data) {
    $.each(data, function(key, value) {
      arr.push(value); // Add data value to an array
    });
  });
  console.log(arr); // Print the array to console
});

Continue reading

Advertisements

Eclipse SVN synchronize problem & solution

I’m sure that I am not the first one who has seen the following errors when synchronizing SVN with eclipse.

Problems reported while synchronizing SVNStatusSubscriber.

0 of 1 resources were synchronized.

Working copy not locked; this is probably a bug…

And as shown in the picture :

Continue reading