0

I dynamically load JS - files:

$(document).ready(function () {
    $.when(
        $.getScript("./setup/js/jquery.knob.js"),
        $.Deferred(function (deferred) {
            $(deferred.resolve);
        })
    ).done(function () {
        $(function ($) {
            $(".knob").knob({});
        });
    });
});

In the source I get the error

"Object [object Object] has no method 'knob' "

When I load the sources inside the page using everything works fine, but I have to wrap the whole page into a JS-File

No other error messages in the console, especially no security-related error messages

(update) When I just copy/paste the complete knob-source into my .JS it works, but of course this is not my preferred solution

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ole Albers
  • 8,715
  • 10
  • 73
  • 166
  • Are you including jQuery? Other than the fact that you are missing a closing `})`, I cannot reproduce the issue: http://jsfiddle.net/nVA3A/ – showdev Jan 31 '14 at 18:42
  • Thats weird. The code is inside a chrome extension. Perhaps thats the cause? – Ole Albers Jan 31 '14 at 18:48

0 Answers0