Problema.. Firefox 2, prototype y json
Publicado por 3Ld0 (3 intervenciones) el 06/04/2007 07:08:34
Hola con la comunidad, he estado probando librerias y me llevado un duro golpe...
tengo un codigo como el siguiente:
<script type="text/javascript" src="<%=request.getContextPath()%>/js/json.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/prototype.js"></script>
</head>
<script type="text/javascript">
function f_prototype(){
var parametro = $F("txtPrueba2");
var path = '<%=request.getContextPath()%>';
var params = 'parametro='+parametro+'&accion=true';
var url = path+'/PruebaEquipo.do';
var MyAjax2 = new Ajax.Updater('div-struts',
url,{method:'get',parameters: params});
}
function f_jason(){
var xx = {"hola":"chao"};
alert(xx.hola);
}
</script>
<body>
<div id="div-struts"></div>
<input type="text" id="txtPrueba2">
<a href="javascript:f_prototype()">prototype</a>
<a href="javascript:f_jason()">json</a>
</body>
veran.. es una prueba, he usado struts... cuando uso json y prototype en el mismo jsp, ya no puedo hacer peticiones ajax con prototype... el <a href="javascript:f_jason()">json</a> funciona ok, pero el otro <a href="javascript:f_prototype()">prototype</a> no hace caso... el problema solo es en el firefox, el IE corre normal, pero en lo personal detesto el IE, asi q me gustaria saber si hay alguna solucion a esto o en q estoy fallando...
Saludos.
tengo un codigo como el siguiente:
<script type="text/javascript" src="<%=request.getContextPath()%>/js/json.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/prototype.js"></script>
</head>
<script type="text/javascript">
function f_prototype(){
var parametro = $F("txtPrueba2");
var path = '<%=request.getContextPath()%>';
var params = 'parametro='+parametro+'&accion=true';
var url = path+'/PruebaEquipo.do';
var MyAjax2 = new Ajax.Updater('div-struts',
url,{method:'get',parameters: params});
}
function f_jason(){
var xx = {"hola":"chao"};
alert(xx.hola);
}
</script>
<body>
<div id="div-struts"></div>
<input type="text" id="txtPrueba2">
<a href="javascript:f_prototype()">prototype</a>
<a href="javascript:f_jason()">json</a>
</body>
veran.. es una prueba, he usado struts... cuando uso json y prototype en el mismo jsp, ya no puedo hacer peticiones ajax con prototype... el <a href="javascript:f_jason()">json</a> funciona ok, pero el otro <a href="javascript:f_prototype()">prototype</a> no hace caso... el problema solo es en el firefox, el IE corre normal, pero en lo personal detesto el IE, asi q me gustaria saber si hay alguna solucion a esto o en q estoy fallando...
Saludos.
Valora esta pregunta


0