<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>http://www.usingjQuery.com</title> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.ajaxlink').click(function(){ $('.ajaxloader').fadeIn(); $('.loader').hide().load('ajaxpage.php', function() { $('.ajaxloader').hide(); $(this).fadeIn(); }); }); }); </script> <style> body{ color: #333; font-family:Arial, Helvetica, sans-serif; padding: 15px; } .ajaxlink{ cursor: pointer; } </style> </head> <body> // <span class="ajaxlink">Click me</span> to chciałbym zmienić na // <a href="' class="ajaxlink">Click me</a> a wtedy nie działa skrypt ładujący dane z pliku php <div class="ajaxloader" style="display: none;"><img src="ajax-loader.gif" alt="loading" /></div> <div class="loader"></div> </body> </html>
co mam poprawić w kodzie , aby to działało ?