[page.html lien]affichera la page page.html après affichage de l'alert
[page.html lien]affichera l'alert puis revient au document.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>avec ou sans return</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript"> //-- affichage pour visualisation if( window.location.search){ document.write( "" +window.location.search +" "); } </script> <script type="text/javascript" src = "jquery-1.4.2.min.js"></script> </head> [page.html Envoi] pas de return false avec return false <script type="text/javascript"> $('#id a').click(function(){ var para =10; var url = "?id=1&newPara=" +para; window.location.search = url; alert( 'Affichage\n' +url); return( false); //-- ICI mets en commentaire ou non }) </script> </html>à vos tests prêt partez...
[# Test]il faut mettre un return( false) en retour de fonction pour que le HREF soit ignoré
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question