Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [js] msg has not properties
Balon
post 18.06.2006, 19:46:13
Post #1





Grupa: Zarejestrowani
Postów: 422
Pomógł: 0
Dołączył: 14.12.2005
Skąd: Wałbrzych

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


  1. function getUsers()
  2. {
  3. var pars = 'act=getusers';
  4. var myAjax = new Ajax.Request(
  5. url,
  6. {
  7. method: 'get',
  8. parameters: pars,
  9. onComplete: updateList
  10. });
  11. }
  12.  
  13. function updateList( msg )
  14. {
  15. $('userList').innerHTML = msg.responseText;
  16. }


i wywala ten komunikat przy updateList.... dlaczego wywala taki komunikat (komunikat taki jak w tytule )?

mam druga podobna funkcje i ona dziala :/

  1. function sendMsg()
  2. {
  3. var pars = 'act=send&msg='+$('msg').value;
  4. var myAjax = new Ajax.Request(
  5. url,
  6. {
  7. method: 'get',
  8. parameters: pars,
  9. onComplete: addMsg
  10. });
  11. }
  12.  
  13. function addMsg( msg )
  14. {
  15. $('mainChat').innerHTML += msg.responseText;
  16. }


--------------------
Postura wielka i morda wredna, jestem Balon, kozak z osiedla !
bzdury.pl - Królestwo rozrywki
Go to the top of the page
+Quote Post
anopak
post 18.06.2006, 20:04:29
Post #2





Grupa: Zarejestrowani
Postów: 124
Pomógł: 0
Dołączył: 26.10.2004
Skąd: Rybnik

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


jeśli chodzi o błąd to szczerze mówiąc trudno mi powiedzieć, może zły adres url? a spróbuj dać dla sprawdzenia co znajduje sie w msg... alert(msg);

pozatym to trochę bezsensu wyłamywać otwarte drzwi, przecież można zastosować Ajax.Updater winksmiley.jpg

  1. function getUsers()
  2. {
  3. var pars = 'act=getusers';
  4. var container = 'mainChat';
  5. var myAjax = new Ajax.Updater(
  6. container,
  7. url,
  8. {
  9. method: 'get',
  10. parameters: pars
  11. });
  12. }


takie wywołanie obsługuje Ci włożenie do elementu container zwrócony tekst z Ajax'a...


--------------------
Hardware: Celeron 3.06, 512 MB DDR
Software: Apache 2.0, MySQL 4.0, php 4.3.1, Zend 5.1, Firefox
Go to the top of the page
+Quote Post

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: 8.07.2025 - 21:53