I did a modification to the javascript for testing and output to the console.
I do get a success for with the following results:
and the following error for
Javascript Test Code
I do get a success for
Code:
console.log('SUCCESS: ' + returndata)
Code:
SUCCESS: [object Object]
Code:
console.log('SUCCESS PARSED: ' + responseData);
Code:
Uncaught SyntaxError: "[object Object]" is not valid JSON
Javascript Test Code
Code:
function testAjax(thisFormData){ document.getElementById('requestStatus').innerHTML = "Sending Data";jQuery(document).ready(function($) {var formData = new FormData($(thisFormData)[0]); jQuery.ajax({url: 'index.php?option=com_ajax&module=omc_web_request&method=test&format=json',type: 'GET',data: formData,async: false,cache: false,contentType: false,processData: false,success: function (returndata) { // was able to connect to serverconsole.log('SUCCESS: ' + returndata);responseData=JSON.parse(returndata);console.log('SUCCESS PARSED: ' + responseData);//if(responseData['status'] == "good") {document.getElementById('requestStatus').innerHTML = returndata;//alert(responseData['alert']);return false;//} else {//document.getElementById('requestStatus').innerHTML = responseData['message'];//}},error: function (error) { // was not able to connect to serverconsole.log('ERROR: ' + error);console.log('ERROR2: ' + returndata);document.getElementById('requestStatus').innerHTML = "<p>There was a problem submitting your request.</p><p>"+responseData+"</p>"; }}); });}
Statistics: Posted by tpage68 — Mon Jul 22, 2024 9:26 pm