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>
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>