Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. text status=:parsererror, error thrown:=SyntaxError: Unexpected token < in JSON at position 0
  2.  
  3. $.ajax({
  4. url: 'private/ajax/get_personas.php',
  5. type:'GET',
  6. contentType: 'application/json; charset=utf-8',
  7. dataType:'JSON',
  8. success: function(data, textStatus, jqXHR) {
  9. alert(data);
  10. },
  11. error: function(data, textStatus, errorThrown) {
  12. console.log('message=:' + data + ', text status=:' + textStatus + ', error thrown:=' + errorThrown);
  13. }
  14. });
  15.  
  16. include('private/connection.php');
  17. echo json_encode("hello");
  18.  
  19. $host = "localhost";
  20. $user = "root";
  21. $pass = "12345";
  22. $db = "pruebas";
  23. $port = 3306;
  24.  
  25. $connection = mysqli_connect($host, $user, $pass, $db, $port);
  26.  
  27. echo json_encode($texto);
  28.  
  29. $.ajax({
  30. url: 'private/ajax/get_personas.php',
  31. type: 'GET',
  32. success: function(data, textStatus, jqXHR) {
  33. console.log(textStatus, jqXHR, data);
  34. },
  35. error: function(data, textStatus, errorThrown) {
  36. console.log('message=:' + data + ', text status=:' + textStatus + ', error thrown:=' + errorThrown);
  37. }
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement