Is there any reason you have this

var StateID = $("#ddlStates > option[selected]").attr
("value");

instead of just this

var StateID = $("#ddlStates").val();

not sure if that's the issue, but it's a start to "less code to break"


On Oct 6, 12:59 am, TRaymond <t...@raymondfamilycentral.com> wrote:
> I was trying out some sample script while trying to learn JQuery and
> it appears that my script works fine under JQuery 1.2.6.  It does NOT
> however work on 1.3.2.  Can anyone identify what the problem is?
>
> <script type="text/javascript"  language="javascript">
>     $(document).ready(function() {
>         $("#ddlStates").change(function() {
>             $("#ddlCities").html("");
>             var StateID = $("#ddlStates > option[selected]").attr
> ("value");
>             if (StateID != 0) {
>                 $.getJSON('/_httpHandlers/LoadCities.ashx?StateID=' +
> StateID, function(cities) {
>                     $.each(cities, function() {
>                         $("#ddlCities").append($("<option></
> option>").val(this['ID']).html(this['City']));
>                     });
>                 });
>             }
>         });
>
>     });
>     </script>
>
> Thanks,
>
> Todd

Reply via email to