I want to create a jQuery multilingual plugin. I also want to open the language files containing the "object" inside my plugin function and access its content.
$.getScript('lang/' + settings.language + '.js').done(function() {
console.log('loaded this');
}).fail(function() {
consoleError('language file does not exist!');
});
The above code gives me the following error.
SyntaxError: expected expression, got '<'
Can you make a suggestion?
My assumption is that you are referencing the script incorrectly and the web server is serving a 404 html page.
Change your code like that: