Try this:
$.post("get_cli.cfm", {status:"singles"},
function(xml){
$("cli", xml).each(function() {
var optn = document.createElement("OPTION");
optn.text = $(this).find('nome').text();
optn.value = $(this).find('id').text();
$( "#test" ).append(optn);
});
});
If anyone knows of an easier way, by all means jump in. :o)
Rey...
Rafael Santos wrote:
> He sure is! I may have said i luv him lol
>
> I can show u Bangow but i cant manage adding new options using 'new
> Options' yet, as soon as i did it i post it here... i changed my focus
> here... too much things to do haha
>
> 2006/9/26, Rey Bango <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
>
> Klaus is the man! He's one of the best contributors here.
>
> Rafael, I'd like to see the end result. Would you mind posting it? I'm
> sure I'll learn a lot from it.
>
> Thanks,
>
> Rey...
>
> Rafael Santos wrote:
> > Thankz Klaus!!!!
> >
> > Lots of alerts showed here.. lol I didnt expect. haha
> >
> > Now it's working fine =P
> >
> > 2006/9/26, Klaus Hartl < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
> > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>:
> >
> >
> >
> > Rafael Santos schrieb:
> > > Yeah, ive done so many copy n paste that i got everything
> mixed
> > huuhuuh
> > >
> > > But could yall explain to me how to use each() to the
> <cli> nodes to
> > > work with it ?
> >
> >
> > From the API docs: "Execute a function within the context of
> every
> > matched element."
> >
> > In other words you pass each a function as argument in which
> the this
> > keyword refers to the iterated element of your jQuery object.
> puh, an
> > example is easier:
> >
> > $.post("get_cli.cfm", { status: "singles" }, function(xml) {
> >
> > $("cli", xml).each(function() {
> > alert(this.nodeName); // "cli"
> >
> > var nome = $(this).find('nome').text();
> > });
> >
> > });
> >
> >
> > -- Klaus
> >
> > _______________________________________________
> > jQuery mailing list
> > [email protected] <mailto:[email protected]>
> <mailto:[email protected] <mailto:[email protected]>>
> > http://jquery.com/discuss/
> >
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > jQuery mailing list
> > [email protected] <mailto:[email protected]>
> > http://jquery.com/discuss/
>
> _______________________________________________
> jQuery mailing list
> [email protected] <mailto:[email protected]>
> http://jquery.com/discuss/
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/