On Dec 10, 8:31 am, Charlie <charlie...@gmail.com> wrote:
>  no idea how I missed that, I certainly know better

One other thing that might make your life easier is the "this" context
of "each".  You can rewrite the body of your loop as a pretty clean
one-liner:

    $(data.statelist).each( function() {
        $("#job_state").append("<option value='" + this.state + "'>" +
this.name + "</option>");
    });

In other words, when the iterations of "each" are executed, "this"
points to the object in your list.  Obviously if you're having
performance problems, you should probably save the selector result and
use array.push/array.join instead of appending each individually, but
I wouldn't bother unless there are problems.  This code is quite
clean.

Good luck,

  -- Scott

Reply via email to