Question: Hi I want to get my local file. So I put in my \*.html file : 

```
<a href="file:///home/dawid.lenkiewicz/232889_kwiecien.csv" type="application/excel" class="excelLink">

```

but it doesn't work. But if I just copy and paste "file:///home/dawid.lenkiewicz/232889\_kwiecien.csv" into a new window I get my file. How to solve this problem in my application?

Answer: 
```
var kk = {
   "158":"Banana",
   "265":"Pear",
   "358":"Apple",
   "864":"Peach"
}

var keys = [];
var datas = {}

$.each(kk, function(key, value){

  keys.push(value)
  datas[value] = key;

})
    var aa = keys.sort()

        var sorted ={}

$.each(aa, function(index, value){

    sorted[datas[value]] = value;
})

```
```
var someObject = {
   "158":"Banana",
   "265":"Pear",
   "358":"Apple",
   "864":"Peach"
};

//flip the name/value pairs
Object.prototype["reverseObject"] = function() {
    var name;
    var newObject = {};
    for(name in this) {
        if(typeof this[name] !== 'function') {
           newObject[this[name]] = name;
        }
    }
    return newObject;
}

var reversedObject = someObject.reverseObject();

console.log(reversedObject);

var i;
var properties = [];
//get all the property names
$.each(reversedObject, function(key, value) {
    if(reversedObject[key] !== this)
    properties.push(key);
});

properties.sort();

var sortedObject = [];

//iterate the array using the order specified
for(i = 0; i < properties.length; i += 1) {
    sortedObject[properties[i]] = reversedObject[properties[i]];
    //document.writeln(properties[i] + " : " + reversedObject[properties[i]]);
}

var sortedObject = sortedObject.reverseObject();

console.log(sortedObject);

```

[Fiddle](http://jsfiddle.net/smacky311/4bwBb/14/)

This creates a sorted array of property names in alphabetical order. Then, this array is used to index the object. This results in the exact object you requested.