javascript - Get json of header included link -
i localize website using json. want include files inside html. how can access json object later in javascript ?
<link rel="localization" hreflang="en" href="lang/en.json" type="application/l10n+json"/>
i don't use path string directly inside javascript. link element loaded automatically ? should use different header tag declare path json file. how can access header tags ?
you can use ajax request if have jquery:
$.getjson("lang/en.json", function(data) { alert(data); });
without jquery gets complicated: consuming json data without jquery (sans getjson)
Comments
Post a Comment