Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] .ajax zawsze zwraca error
flip02
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 13.08.2011

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


Zawsze dostaje error, co tym razem jest nie tak? W firebugu nie pokazuja mi się żadne errory.

  1. $('#stype').change(function(){
  2. $.ajax({
  3. type: "POST",
  4. url: "http://localhost/ajax.php",
  5. data: "type="+ $('#stype').attr('value') +"&color="+ $('#scolor').attr('value') +"&pattern="+ $('#spattern').attr('value'),
  6. dataType: "html",
  7. success: function(){
  8. alert("cuks");
  9. },
  10. error: function(msg){alert(msg)}
  11. })});


w pliku ajax.php mam tylko <p>cos</p>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
flip02
post
Post #2





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 13.08.2011

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


coś robię dalej źle, bo w odpowiedzi nic nie dostaję i pewnie dlatego wywala ciągle błąd. Moje nagłówki:

  1. Response Headers
  2.  
  3. HTTP/1.1 200 OK
  4. Date: Sun, 14 Aug 2011 11:46:43 GMT
  5. Server: Apache/2.2.16 (Ubuntu)
  6. X-Powered-By: PHP/5.3.3-1ubuntu9.5
  7. Vary: Accept-Encoding
  8. Content-Encoding: gzip
  9. Content-Length: 20
  10. Keep-Alive: timeout=15, max=100
  11. Connection: Keep-Alive
  12. Content-Type: text/html
  13.  
  14.  
  15. Request Headers
  16.  
  17. OPTIONS /ajax.php HTTP/1.1
  18. Host: localhost
  19. User-Agent: Mozilla/5.0 ....
  20. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  21. Accept-Language: en-us,en;q=0.5
  22. Accept-Encoding: gzip,deflate
  23. Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  24. Keep-Alive: 115
  25. Connection: keep-alive
  26. Access-Control-Request-Method: POST
  27.  


Origin wyżej wygląda tak : http://www.localhost:8085

ajax.php - tu robie echo z paragrafem.

Ten post edytował flip02 14.08.2011, 12:56:46
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 11.10.2025 - 13:54