Skip to content

Instantly share code, notes, and snippets.

Nikolay Traykov ntraykov

Block or report user

Report or block ntraykov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jsonp-dynamic-loading.html
<script>
var s = document.createElement("script");
s.src = "https://my-server.com/js/data/" + document.location.hostname + '.json';
document.body.appendChild(s);
</script>
View dynamic-import.js
import i18n from './' + document.location.hostname + '.json'
// or var i18n = require('./' + document.location.hostname + '.json')
@ntraykov
ntraykov / static-import.js
Last active Jul 9, 2018
Static import of Vue initialization data
View static-import.js
import messages from './i18n.json'
import data from './data.json'
var i18n = new VueI18N({
locale: 'en',
messages
})
//etc...
You can’t perform that action at this time.