Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/12/2014, 05:07
Avatar de skywolker
skywolker
 
Fecha de Ingreso: julio-2011
Ubicación: España
Mensajes: 195
Antigüedad: 12 años, 9 meses
Puntos: 8
Pregunta por que ajax type get no quiere funcionar

e probado todos estos y ninguno funciona antes funcionaba este :
Código HTML:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js"></script>

<script language="JavaScript" type="text/javascript">
<!--

function confirmar()   {    


 $.ajax({
		type: "GET",
		url: "prueba_mp.php",
		data: "prueba=hola mundo",
		success: function(msg){
		alert("estos es un");
		//	$("#privado_nombre_msg").html(msg);

		}, 
		error: function(xho){
			alert("Error:"+xho.responseText);
		}
	});	
}//funcion confirmarsalida

//-->
</script>
<a href="javascript:confirmar()">confirmar</a> 
pero no se por que no quiere funcionar

y ninguno de estos funciona
Código HTML:


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js"></script>

<script language="JavaScript" type="text/javascript">
<!--

	
		/***
		$.ajax({
		type:'GET',
		url:'prueba_mp.php',
		data:"userId=12345&userName=test",
   success:function(data){
     alert('successful');
   }
 });
		***/
			/***
		$.ajax(
   {
      type:'GET',
      url:'prueba_mp.php',
      data:"userId=12345&userName=test",
      success: function(data){
        alert('successful');
      }
   }
);
		***/
			/***	
$.ajax({
  type:'GET',
  url:'prueba_mp.php',
  data:{"userId":"12345","userName":"test"},
  success:function(data){
    alert('successful');
  }
);
***/	

/***	
		$.ajax({
  url: "prueba_mp.php",
  context: document.body
}).done(function() {
  $( this ).addClass( "done" );
    alert('successful');
});

***/

function confirmar()   {    

 $.ajax({
		type: "GET",
		url: "prueba_mp.php",
		data: "prueba=hola mundo",
		success: function(msg){
		alert("estos es un");
		//	$("#privado_nombre_msg").html(msg);

		}, 
		error: function(xho){
			alert("Error:"+xho.responseText);
		}
	});	
}//funcion confirmarsalida

//-->
</script>
<a href="javascript:confirmar()">confirmar</a>