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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -