 <p>If you are saving javascript in external file, save as filename.json</p> <pre><code>var employees = [ { "firstName":"John" , "lastName":"Doe" }, { "firstName":"Anna" , "lastName":"Smith" }, { "firstName":"Peter" , "lastName": "Jones" } ]; </code></pre> <p>Then improt filename.json in webpage using jquery as //jquery plugin must be added first</p> <pre><code>$(document).ready(function(){ $.getJSON("filename.json",function(result){ alert(result[0].firstname + result[0].lastname); }); }); </code></pre>