javascript - Cannot load static text from local file into js variable with jQuery $.GET -


i'm developing google chrome extension. have static countrylist.js file placed locally in same folder file code below. want load countrylist.js content js variable of second file, code doesn't work, though works if countrylist.js placed on remote server. doing wrong? can not place on server because forbidden chrome extensions.

 var countrylist = $.get("countrylist.js" + localstorage.uid + "&ver=" + localstorage.version, function () {    callback()  } 

possible duplicate: how can load local file using jquery? (with file://)

get requires http connection, without local web server won't work. while can open , read file using html5, can't load javascript resource way.

if page loaded locally, you'd load js using script tag.

<script type='text/javascript' src='/objectdata.js'></script> 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -