2

我正在使用 wordpress 4.7.3 版本。我安装了一个新主题。我在文本区域旁边的控制台中发现错误。

未捕获的错误:菜单小部件实例没有此类方法“实例”

代码是:

jQuery(function() {
    jQuery("#address").autocomplete({
        //This bit uses the geocoder to fetch address values
        source: function(request, response) {
            geocoder.geocode( {'address': request.term }, function(results, status) {
                response(jQuery.map(results, function(item) {
                    return {
                        label:  item.formatted_address,
                        value: item.formatted_address,
                        latitude: item.geometry.location.lat(),
                        longitude: item.geometry.location.lng()
                    }
                }));
            })
        },
        //This bit is executed upon selection of an address
        select: function(event, ui) {
            jQuery("#latitude").val(ui.item.latitude);
            jQuery("#longitude").val(ui.item.longitude);

            var location = new google.maps.LatLng(ui.item.latitude, ui.item.longitude);

            marker.setPosition(location);
            map.setZoom(16);
            map.setCenter(location);

        }
     });
});

问题出在哪里?

4

1 回答 1

3

我有一个确切的问题。问题是插件正在加载旧版本的 jQuery 移动插件。

于 2017-04-27T08:53:31.120 回答