Error too much recursion
Publicado por Alfredo (17 intervenciones) el 22/04/2013 11:04:15
Hola,
cuando ejecuto lo siguiente se me queda el navegador pillado; el Firefox en consola me muestra el error: "too much recursion" y el chrome me muestra el error "Uncaught RangeError: Maximum call stack size exceeded" pero no consigo ver dónde está el problema, (creo que el problema está en la función $('button.aenv').live('click',function() ) gracias:
cuando ejecuto lo siguiente se me queda el navegador pillado; el Firefox en consola me muestra el error: "too much recursion" y el chrome me muestra el error "Uncaught RangeError: Maximum call stack size exceeded" pero no consigo ver dónde está el problema, (creo que el problema está en la función $('button.aenv').live('click',function() ) gracias:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
$(window).ready(function(){
/*Google Map*/
function calculaRuta(res) {
var llt=res.sal.split('|');
var sal=new google.maps.LatLng(llt[0], llt[1]);
llt=res.lle.split('|');
var lle=new google.maps.LatLng(llt[0], llt[1]);
var esca = [];
for(var i=0;i<res.esc.length;i++){
llt=res.esc[i].split('|');
llt=new google.maps.LatLng(llt[0], llt[1]);
esca.push({
location:llt,
stopover:true
});
}
var request = {
origin:sal,
destination:lle,
waypoints: esca,
optimizeWaypoints: true,
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(result);
}
});
}
/*Resto*/
$( "#tabs" ).tabs();
$('.gridCheckBox').live('click',function(){
var tipo;
if($(this).is(':checked')){tipo='add';}else{tipo='del';}
$.ajax({
type: "GET",
url: urlApi+'?api=rutas&tipo='+tipo+'&sensor='+$(this).val()});
});
$('.sendRuta').click(function(){
$.ajax({
type: "GET",
url: urlApi+'?api=rutas&tipo=calc_normal'});
});
$('button.aenv').live('click',function(){
var ca='',km='',error=false;
var $div=$(this).parent();
$div.find('input').each(function(i){
if($(this).attr('name')!='km' && $(this).attr('name')!='car' && $(this).attr('name')!='por'){
ca+=$(this).attr('name')+'='+$(this).val()+'&';
}else{
km+=$(this).attr('name')+'='+$(this).val()+'&';
}
if($(this).val()==''){alert('Por favor, rellene los campos de direccion de salida.');error=true;return;}
});
if(error==true){return false;}
if($(this).attr('id')=='btnRuta_2')km+='&aut=si';
$.getJSON(urlApi+'?api=googlemap_lat&'+ca+'jsoncallback=?',function(res){if(res.stt=='err'){alert('No se ha podido geolocalizar esa direccion.');error=true;return;
}else{
$.getJSON(urlApi+'?api=rutas&tipo=calc_normal&longi='+res.longitud_sen+'&lati='+res.latitud_sen+'&'+km+'jsoncallback=?',function(res){
$('#selectRuta').slideUp('slow');
if(document.getElementById("textoRutasOb")){
$('#textoboxRuta').fadeIn('slow');
$('#textoRutasOb').html('Carga recogida: <b>'+res.car+'</b>');
}
calculaRuta(res);
});
}
});
});
});
Valora esta pregunta


0