Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery], ładownia treści z zew. pliku do diva
vahooz
post 28.08.2009, 12:06:39
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 28.05.2006

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


Witam,

Problem z którym nie mogę sobie poradzić od 6 h. Wygląda to tak:
  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.  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <link rel="stylesheet" type="text/css" href="./css/style.css" />
  6. <link rel="stylesheet" type="text/css" href="./css/rating.css" />
  7. <title>Test</title>
  8. <script type="text/javascript" src="./js/jquery.js"></script>
  9. <script type="text/javascript" src="./js/jquery.rating.js"></script>
  10. <script type="text/javascript">
  11. function ahah(url, target) {
  12. document.getElementById(target).innerHTML = ' Ładuje dane...';
  13. if (window.XMLHttpRequest) {
  14. req = new XMLHttpRequest();
  15. } else if (window.ActiveXObject) {
  16. req = new ActiveXObject("Microsoft.XMLHTTP");
  17. }
  18. if (req != undefined) {
  19. req.onreadystatechange = function() {ahahDone(url, target);};
  20. req.open("GET", url, true);
  21. req.send("");
  22. }
  23. }
  24. function ahahDone(url, target) {
  25. if (req.readyState == 4) {
  26. if (req.status == 200) {
  27. document.getElementById(target).innerHTML = req.responseText;
  28. } else {
  29. document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
  30. }
  31. }
  32. }
  33. function load(name, div) {
  34. ahah(name,div);
  35. return false;
  36. }
  37.  
  38. $(document).ready(function() {
  39. load('./html_forms/ankieta.php','frame_form');
  40. $('#rate1').rating('www.url.php', {maxvalue:5});
  41. });
  42. </head>
  43. <div>
  44. <form>
  45. <div id="rate1" class="rating">&nbsp;</div>
  46. <div class="frame" id="frame_form" >&nbsp;</div>
  47. </form>
  48. </div>
  49. </body>
  50. </html>

Jak widać z powyższego kodu ładuję plik ankieta.php do div'a frame_form
Plik ankieta zawiera:
  1. <div id="rate1" class="rating">
  2. </div>

W divie <div id="rate1" class="rating"></div> ładowany jest plugin star-rank.
Div ten jest osadzony w index.php i w ankieta.php. W index.php działa a w ankieta.php nie.
Ma ktoś jakiś pomysł, sugestie?

Pozdrawiam.

Ten post edytował vahooz 28.08.2009, 12:07:46


--------------------
shit, fuck and microsoft
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 16:59