コード内の javascript クラスにプロトタイプを追加して問題なく動作する例が他にもいくつかあります。
問題の部分は次のとおりです。
var opt = new Settings;
function Settings() {
this.initjQuerySelectors();
this.sorted_columns_url = this.getSortedColumnsUrl();
}
Settings.prototype.initjQuerySelectors = function() {
this.data_store_selector = $('.data_store.display');
};
Settings.prototype.getSortedColumnsUrl = function() {
return this.data_store_selector.val();
};
次のエラーが発生します。
Uncaught TypeError: Object #<Settings> has no method 'initjQuerySelectors'
エラーをキャッチしようとすると、getSortedColumnsUrl();
どちらにも方法がないことが示されました。
chrome 開発ツールでコードを見ると、追加した Settings プロトタイプには実際には何もないことがわかります。問題は、その理由を理解できないことです。
どんな助けでも大歓迎です。