I am developing web project by using Spring3,struts 2 and jquery jquery-1.8.2.js.
this is my jquery ajax call
function(){
var data = {};
data['patientFETO.title'] = $('#idSelTitle').val().trim();
data['patientFETO.firstName'] = $('#idFirstName').val().trim();
data['patientFETO.lastName'] = $('#idLastName').val().trim();
data['patientFETO.mobileNumber'] = $('#idMobileNumber').val().trim();
data['patientFETO.idNumber'] = $('#idIDNumber').val().trim();
data['patientFETO.gender'] = $('#idSelGender').val().trim();
data['patientFETO.age'] = $('#idAge').val().trim();
data['patientFETO.dob'] = $('#idDOB').val().trim();
$.ajax({url:'savePatientAction',
cache: false,
type:"POST",
data:data,
dataType: 'json',
error: function(XMLHttpRequest, textStatus, errorThrown){
alert('Error ' + textStatus);
alert(errorThrown);
alert(XMLHttpRequest.responseText);
},
success: function(data){
alert('SUCCESS');
}
and this is my struts action mapping
<action name="savePatientAction" class="appointmentAction" method="doPatientSave">
<result name="success">/account/confirmation.jsp</result>
<exception-mapping result="success" exception="e"></exception-mapping>
</action>
when i run it gives SyntaxError: JSON.parse: unexpected character "http://localhost:8080/ML/resources/js/jquery-1.8.2.js" Line 7764
Please give me idea to fix this issue Thanks