Tag: 构造函数

没有对象的访问方法(如静态)

我想在不创建对象或调用document.ready事件的构造函数的情况下调用类方法。 我尝试了不同的选择,但没有任何效果。 var objReportsInterface; class ReportsInterface extends ReportBase { constructor() { super(); objReportsInterface = this; } subCategories() {} } $(document).ready(function() { $(“dropdown”).on(‘change’, function() objReportsInterface.subCategories(); }) }) 我找到了一个静态方法,但获得了与我的代码相关的任何示例。 在我的情况下,我可以使用静态方法吗?

在javascript中,什么是构造函数? 什么不是?

我正在使用jQuery的插件。 它在webkit中运行良好,但是当我在firefox中尝试它时,我得到以下firefox错误: google.maps.Geocoder is not a constructor $(‘.to, .from’).geo_autocomplete(new google.maps.Geocoder, { 这是所有的jquery: $(‘.to, .from’).geo_autocomplete(new google.maps.Geocoder, { mapkey: ‘ABQIAAAAbnvDoAoYOSW2iqoXiGTpYBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQNumU68AwGqjbSNF9YO8NokKst8w’, selectFirst: false, minChars: 3, cacheLength: 50, width: 235, scroll: true, scrollHeight: 330 }); 什么是构造函数和firefox如何向我指出它? http://dev.resihop.nu是该网站