JQuery Ajax post not working on Mac (Safari and Firefox)

JQuery Ajax post not working on Mac (Safari and Firefox)

Hi!

My website has a JQuery dialog with a textarea where the user can type a text and submit. The submit is an ajax request to the server.

This is the code:

  1. $('#textEdit').dialog({
  2. show: 'fade',
  3. hide: 'fade',
  4. autoOpen: false,
  5. modal: true,
  6. resizable: false,
  7. closeOnEscape: true,
  8. width: 520,
  9. height: 310,
  10. buttons: {
  11. "Update Content": function() {
  12. var newText = encodeURIComponent(getRichTextContent());
  13. var url = "../../adminnew/updateText.php";
  14. var pageNumber = document.getElementById('currentPage').value;
  15. var dataString = 'pageNumber='+pageNumber+'&field='+field+'&value='+newText;
  16. var dialogObj = $(this);
  17. var editor = tinyMCE.get('richTextEditor');
  18. // show progress
  19. editor.setProgressState(1);
  20. $.ajax({
  21. type: 'POST',
  22. url: url,
  23. data: dataString,
  24. dataType: 'json',
  25. success: function(data){
  26. // hide progress
  27. editor.setProgressState(0);
  28. // close current dialog
  29. dialogObj.dialog("close");
  30. if (data.status == 1){
  31. $('#'+field).html(data.updatedText);
  32. } else {
  33. // open generic Error dailog
  34. $('#genericError').dialog('open');
  35. }
  36. },
  37. error: function(){
  38. // hide progress
  39. editor.setProgressState(0);
  40. // close current dialog
  41. dialogObj.dialog("close");
  42. // open generic Error dailog
  43. $('#genericError').dialog('open');
  44. }
  45. });
  46. }
  47. }
  48. });
I can see the request on Firebug, so I added and error_log to my code.

  1. error_log(print_r($_POST,1));
The result is an empty array.

The ajax request works perfectly on Firefox, Chrome and IE on PCs, but it does not work on Mac.

Does anyone know what can be?

Thanks!

Rafael