Following is the code I use for an ajax call. While executing this it gives me an error xml parsing error syntax error line number 1 column 1 in fiebug. I viewed some questions stating the same problem and they suggested that there was some syntactical problem. I checked again but couldn't find out the real culprit. Please tell me what I am doing wrong.
$.ajax({type: "GET",
cache: false,
url: 'url',
data : 'param1='+ param1val+ '¶m2='+param1val,
dataType: 'json',
success: function(Obj){
if(Some Condition){
//Some Code
}else{
//else code
}
},
});
Here goes some controller code.
@RequestMapping(value = "url", method = RequestMethod.GET)
public @ResponseBody SomeObject url(@RequestParam(value="param1val") String abc ,@RequestParam(value="param2val") String xyz)
{ //some code}
Edit I added some debugging code to JS and the controller code as well. To my surprise, control executes successful first comes (in JS) and then goes into controller. Is it supposed to happen like this?