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:
- $('#textEdit').dialog({
- show: 'fade',
- hide: 'fade',
- autoOpen: false,
- modal: true,
- resizable: false,
- closeOnEscape: true,
- width: 520,
- height: 310,
- buttons: {
- "Update Content": function() {
- var newText = encodeURIComponent(getRichTextContent());
- var url = "../../adminnew/updateText.php";
- var pageNumber = document.getElementById('currentPage').value;
- var dataString = 'pageNumber='+pageNumber+'&field='+field+'&value='+newText;
- var dialogObj = $(this);
- var editor = tinyMCE.get('richTextEditor');
- // show progress
- editor.setProgressState(1);
- $.ajax({
- type: 'POST',
- url: url,
- data: dataString,
- dataType: 'json',
- success: function(data){
- // hide progress
- editor.setProgressState(0);
- // close current dialog
- dialogObj.dialog("close");
- if (data.status == 1){
- $('#'+field).html(data.updatedText);
- } else {
- // open generic Error dailog
- $('#genericError').dialog('open');
- }
- },
- error: function(){
- // hide progress
- editor.setProgressState(0);
- // close current dialog
- dialogObj.dialog("close");
- // open generic Error dailog
- $('#genericError').dialog('open');
- }
- });
- }
- }
- });
I can see the request on Firebug, so I added and error_log to my code.
- 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