我的scripts.js文件中有一些jquery和ajax很麻烦。我一直在尝试在控制台中遵循模式,但这一切都非常令人沮丧地无法预测。 ajax总是这样吗? (我正在处理的代码是其他人所做的事情。)
我怎么能输入一行代码基本上说'停止,不做任何其他事情!不再需要任何东西 - 直到点击另一个按钮,或者从其他地方调用动作'。
我认为这有助于解决我的一些问题。
我把我的功能放在下面,我希望它停下来。谢谢你的帮助。
function initialize_google_maps2() {
console.log('google maps 2 initialized');
var currentlatlng = new google.maps.LatLng(map_latitude, map_longitude);
var zoom = 10;
var myOptions = {
zoom: zoom,
center: currentlatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP, // ROADMAP, SATELLITE, HYBRID
streetViewControl: false
};
map = new google.maps.Map(document.getElementById("map_canvas2"), myOptions);
var marker = new google.maps.Marker({map: map, position: currentlatlng, icon:{oppacity:0}});
// map.setCenter(currentlatlng);
var circle = new google.maps.Circle({
map: map,
fillOpacity: 0,
strokeWeight: 2,
strokeOpacity: 0.7,
radius: 10000,
});
circle.bindTo('center', marker, 'position');
console.log('end of initialize google 2 function')
// stop, and don't do anything else! no more loads of anything - until another button is clicked, or action called from
//somewhere else
}
答案 0 :(得分:0)
您可以使用JQuery的.ajaxStop()。我希望我回答你的问题