Getting "invalid assignment left-hand side"
<p>In my JavaScript file I'm trying to load an external API JavaScript and calling function in callback. Its returning "invalid assignment left-hand side" on second line <code>window.loadApi  = function(callback) {</code>. Totally confuse because syntactically it is looking okay.</p>

<pre><code>var apiUrl = window.location.protocol + "my url";
window.loadApi = function(callback) {
    if (window.$MY) {
        callback();
    } else {
        $.getScript(apiUrl, function() {
            $($MY.docReady);
            callback();
        });
    }
};

loadApi(function() {
    //my function
}); 
</code></pre>
