How can I read data from a URL?
<p>I have a function in javascript which I hard-coded as of now:</p>

<pre><code>function getCarData() 
{
    return 
    [
        {car: "Nissan", year: 2009, chassis: "black", bumper: "black"},
        {car: "Nissan", year: 2006, chassis: "blue", bumper: "blue"},
        {car: "Chrysler", year: 2004, chassis: "yellow", bumper: "black"},
        {car: "Volvo", year: 2012, chassis: "white", bumper: "gray"}
    ];
}
</code></pre>

<p>Now.. this was just to unit test whether the code will work or not.. But now it is working..</p>

<p>I am generating this data on backend and am mapping it to the directory on server (which is localhost at the moment)</p>

<p>So if I go to localhost:5000/cardata
I have exact same data i.e</p>

<pre><code>[
    {car: "Nissan", year: 2009, chassis: "black", bumper: "black"},
    {car: "Nissan", year: 2006, chassis: "blue", bumper: "blue"},
    {car: "Chrysler", year: 2004, chassis: "yellow", bumper: "black"},
    {car: "Volvo", year: 2012, chassis: "white", bumper: "gray"}
];
</code></pre>

<p>What changes I should made on my javascript file in order to make this work?</p>
