JQuery response comming as an XML and not as a JS.
Hi,
I am a newbee with JQuery. I was trying to submit a form constructed with RoR form_for helper with the jQuery's submit process and was expecting a js response. But I was getting an XML response. I had infact icluded the js module as below saying that I am expecting a js from the action as shown below.
$.ajaxSetup({
'beforeSend' : function(xhr) {xhr.sendRequestHeader("Accept","text/javascript")}
})
I had actually written a function for window.onload which gives a fadeIn functionality. The form gets submitted successfully to the controller's action and logs all the loggers. But nothing happens after. There comes a javascript error saying that
"missing } in XML expression".
This points to
$(document).ready(function() {
$("#first_page").fadeIn(2000);
})
please help me in where the issue can be. Thanks in advance for the help.
Regards,
Anand