Opened 12 years ago
Closed 12 years ago
#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: | ||
Blocked by: | Blocking: |
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 (2)
comment:1 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Milestone: | 1.next |
Priority: | undecided → low |
Type: | enhancement → bug |
comment:2 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is not a jQuery bug. When you pass the wrong values, you will get unexpected results. The api docs list all the dataType's in lowercase - i would suggest sticking to that format.
Not sure why this marked as an enhancement.