Ticket #7644 (closed bug: invalid)
DataType defination in Ajax calls
| Reported by: | fatihacet | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | ajax | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi jQuery Team,
First of all, I want to say, thanks all the team such as solid and impressive job. You should know that, you rock the world and changed the flowing of web development and see the world JavaScript is not an monster or evil. :-) So again thanks for that. As a Front End Web Developer, I really love to code with jQuery.
Then the matter is, when I make an ajax call to server I should always define dataType as lowercase, such as "json". For example check the following code please,
$.ajax({
url: 'foo.php',
type: 'GET',
dataType: 'json',
success: function(data){
console.log(data.success)
}
})
this works fine as expected. But if I accidently code dataType: 'JSON', it returns an error which says data.success is undefined.
Thanks..
Fatih ACET
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Not sure why this marked as an enhancement.