Ticket #6010 (closed bug: invalid)
bug request with getJSON options is null
| Reported by: | gtraxx | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | ajax | Version: | 1.4.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The ajax request getJSON not working well with version 1.4 I use a function that works very well with 1.3.2.
$ (function () ( $. getJSON ( "/ json / getidclc =" + $ ( 'select # idclc'). val (), function (j) ( var options = '<option value="0"> No subcategory </ option>'; for (var i = 0; i <j.length; i + +) ( options + = '<option value='" j[i].optionValue + +'">' + j [i]. optionDisplay + '</ option>'; ) $ ( "select # idcls"). html (options); )); $ ( "select # idclc"). change (function () ( $. getJSON ( "/ json / getidclc =" + $ (this). val (), function (j) ( var options = '<option value="0"> No subcategory </ option>'; for (var i = 0; i <j.length; i + +) ( options + = '<option value='" j[i].optionValue + +'">' + j [i]. optionDisplay + '</ option>'; ) $ ( "select # idcls"). html (options); )); )); ));
Attachments
Change History
comment:1 Changed 3 years ago by john
- Status changed from new to closed
- Resolution set to invalid
You need to make sure that the JSON being returned from your server isn't malformed, we now check for that in 1.4: http://yehudakatz.com/2010/01/15/jquery-1-4-and-malformed-json/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

