Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][AJAX][JavaScript] Zamiana znacznika span na atrybut href
slawekxx
post
Post #1





Grupa: Zarejestrowani
Postów: 189
Pomógł: 2
Dołączył: 28.08.2010

Ostrzeżenie: (0%)
-----


Nie mogę sobie poradzić z takim małym skryptem
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>http://www.usingjQuery.com</title>
  6. <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
  7.  
  8. <script type="text/javascript">
  9. $(document).ready(function(){
  10. $('.ajaxlink').click(function(){
  11. $('.ajaxloader').fadeIn();
  12. $('.loader').hide().load('ajaxpage.php', function() {
  13. $('.ajaxloader').hide();
  14. $(this).fadeIn();
  15. });
  16. });
  17. });
  18. </script>
  19.  
  20. <style>
  21. body{
  22. color: #333;
  23. font-family:Arial, Helvetica, sans-serif;
  24. padding: 15px;
  25. }
  26.  
  27. .ajaxlink{
  28. cursor: pointer;
  29. }
  30. </style>
  31.  
  32. </head>
  33. <body>
  34.  
  35. // <span class="ajaxlink">Click me</span> to chciałbym zmienić na
  36. // <a href="' class="ajaxlink">Click me</a> a wtedy nie działa skrypt ładujący dane z pliku php
  37. <div class="ajaxloader" style="display: none;"><img src="ajax-loader.gif" alt="loading" /></div>
  38. <div class="loader"></div>
  39. </body>
  40. </html>


co mam poprawić w kodzie , aby to działało ?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 09:15