contentType is the HTTP header sent to the server, specifying a particular format. Example: I'm sending JSON or XML dataType is you telling jQuery what kind of response to expect. Expecting JSON, or XML, or HTML, etc. The default is for jQuery to try and figure it out. The $.ajax() documentation has full descriptions of these as well.
Possible Duplicate: How does AJAX work? Note: This is a community wiki post I've often heard of AJAX being used for providing a user with dynamic content. What is it and how does it work?
I have a form with name orderproductForm and an undefined number of inputs. I want to do some kind of jQuery.get or ajax or anything like that that would call a page through Ajax, and send along a...
Can I use the following jQuery code to perform file upload using POST method of an ajax request ?
But $.ajax does not return a function (which could be called), it returns a jqXHR object, so it throws an error. Your answer is correct, the additional () are the problem, but the description of the problem is not correct (it's not a syntax error, well at least not for the parser).
The ajax request is sending dataType: json and data: {loginId: " appletest@somedomain.com ", client: "698983"}. While going into the postman, I am trying to send body parameters as JSON with all the above info and Content-Type: application/json in headers but it fails with 500.
You should include a hidden CSRF (cross site request forgery) token field in the form so that the CSRF protection middleware can validate the request. Laravel automatically generates a CSRF "token" for each active user session managed by the application. This token is used to verify that the authenticated user is the one actually making the requests to the application. So when doing ajax ...