On 9/26/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
>
>
> Donny Kurnia schrieb:
> > I've got this result while debugging with firebug:
> >
> >>>> $("type",line)
> > [<type value="select">]
> >>>> $("type",line).attr("value")
> > --result nothing
> >>>> $("type",line).get(0)
> > <type value="select">
> >>>> $("type",line).get(0).attr("value")
> > --result nothing
> >
> > How do I got the value attribute from $("type",line) without assign it
> > to another variable?
> > Why chainable method didn't work for $().get() ??
>
>
> Because there is no type element in HTML, I assume you process XML here.
> Do you have the proper MIME type set for that?
>
> For XML I'd use getAttribute because val() is shorthand for HTML's value
> attribute and I'm not sure if it works in XML.
>
> I would stick to the traditional DOM methods:
>
> $("type",line)[0].getAttribute("value");
>
> get(0) or the shorthand [0] breaks the chain, because it returns the
> true DOM node you are working with, thus you cannot apply jQuery methods
> anymore.
>
>
> -- Klaus

All right. Thanks to all. I understand the concept now. And yes, I
parse xml file.

One more question, still in the topic, and same xml file.
I've using this code:

var label = line.getElementsByTagName("properties")[0].getAttribute("label");

When I change it to:

var label = $("properties",line).attr("label");

it's work in Firefox, but in IE6, the script seem to stop responding.
When I click the browser window, IE show a ppup warning ask me to
wheter stop the script or continue it.

Any explanation for this 'bug' in IE6 ??

--
Donny Kurnia
http://hantulab.multiply.com/
http://hantulab.blogspot.com/
-------------------------------------------
At times the world can seem an unfriendly and sinister place. But
believe us when we say there is much more good in it than bad. And
what might seem to be a series of unfortunate events, may in fact, be
the first steps of a journey.
-- A Series of Unfortunate Events

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to