Re: [jQuery] Question on jQuery 1.0.2
> Antonio Collins wrote: >> Second parameter is search type. >> vAttrValue = object.getAttribute(sAttrName [, iFlags]) [snip] >> 2 Returns the value exactly as it was set in script or in the source >> document. I've encountered this before, and had discussion on the list about it. I don't think it was concluded though. The problem is that the two argument getAttribute() only exists on HTML elements, NOT XML elements! (in IE that is) To recap, the last post about this was from John Resig: > Specifically, this relates to the 'href' attribute - since browsers > frequently interpret the URL provide into a full URL. If you were to > put in "/foo.html", the browser would (instead) return > "http://mydomain.com/foo.html"; > > Although, if it dies on XML documents, I may have to reconsider using > it. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Question on jQuery 1.0.2
As Klaus mentioned it looks like a Microsoft extension. http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/getattribute.asp http://www.w3.org/TR/2000/WD-DOM-Level-1-2929/DOM.txt And oddly enough, IE6 is throwing an error that points to line 702 in jQuery, which is this line. You can reproduce this at: http://imaptools.com:8081/maps/demo.html and double click on the map in IE6. -Steve Antonio Collins wrote: > Second parameter is search type. > vAttrValue = object.getAttribute(sAttrName [, iFlags]) > > sAttrName Required. String that specifies the name of the attribute. > > iFlags Optional. Integer that specifies one or more of the following flags: > 0 Default. Performs a property search that is not case-sensitive, and > returns an interpolated value if the property is found. > 1 Performs a case-sensitive property search. To find a match, the uppercase > and lowercase letters in sAttrName must exactly match those in the attribute > name. > 2 Returns the value exactly as it was set in script or in the source > document. > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Brandon Aaron > Sent: Tuesday, October 10, 2006 8:24 AM > To: jQuery Discussion. > Subject: Re: [jQuery] Question on jQuery 1.0.2 > > I would also like to know what the 2 is for. I didn't know > getAttribute() could take a second param. > > -- > Brandon Aaron > > On 10/9/06, Stephen Woodbridge <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I was testing and found some very strange behavior in IE6 and Opera 9 >> but works fine on FF 1.0.5. It looks like the problem is pointing to: >> >> line: 704 >> return elem.getAttribute( name, 2 ); >> >> in this block of code: >> >> ... >> } else if ( elem.getAttribute != undefined ) { alert(name + " >> = " + value); >> if ( value != undefined ) elem.setAttribute( name, value ); >> return elem.getAttribute( name, 2 ); >> } else { >> ... >> >> >> >> Is this correct? >> What does the 2nd argument do? >> >> -Steve >> >> ___ >> jQuery mailing list >> discuss@jquery.com >> http://jquery.com/discuss/ >> > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Question on jQuery 1.0.2
Second parameter is search type. vAttrValue = object.getAttribute(sAttrName [, iFlags]) sAttrName Required. String that specifies the name of the attribute. iFlags Optional. Integer that specifies one or more of the following flags: 0 Default. Performs a property search that is not case-sensitive, and returns an interpolated value if the property is found. 1 Performs a case-sensitive property search. To find a match, the uppercase and lowercase letters in sAttrName must exactly match those in the attribute name. 2 Returns the value exactly as it was set in script or in the source document. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brandon Aaron Sent: Tuesday, October 10, 2006 8:24 AM To: jQuery Discussion. Subject: Re: [jQuery] Question on jQuery 1.0.2 I would also like to know what the 2 is for. I didn't know getAttribute() could take a second param. -- Brandon Aaron On 10/9/06, Stephen Woodbridge <[EMAIL PROTECTED]> wrote: > Hi all, > > I was testing and found some very strange behavior in IE6 and Opera 9 > but works fine on FF 1.0.5. It looks like the problem is pointing to: > > line: 704 > return elem.getAttribute( name, 2 ); > > in this block of code: > > ... > } else if ( elem.getAttribute != undefined ) { alert(name + " > = " + value); > if ( value != undefined ) elem.setAttribute( name, value ); > return elem.getAttribute( name, 2 ); > } else { > ... > > > > Is this correct? > What does the 2nd argument do? > > -Steve > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Question on jQuery 1.0.2
Brandon Aaron schrieb: > I would also like to know what the 2 is for. I didn't know > getAttribute() could take a second param. It's a microsoft extension indicating case-sensitivity. If set to 1 it forces case-sensitivity, so obviously setting it to 2 is the same as leaving it out. I wonder why this is still in there. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Question on jQuery 1.0.2
I would also like to know what the 2 is for. I didn't know getAttribute() could take a second param. -- Brandon Aaron On 10/9/06, Stephen Woodbridge <[EMAIL PROTECTED]> wrote: > Hi all, > > I was testing and found some very strange behavior in IE6 and Opera 9 > but works fine on FF 1.0.5. It looks like the problem is pointing to: > > line: 704 > return elem.getAttribute( name, 2 ); > > in this block of code: > > ... > } else if ( elem.getAttribute != undefined ) { > alert(name + " = " + value); > if ( value != undefined ) elem.setAttribute( name, value ); > return elem.getAttribute( name, 2 ); > } else { > ... > > > > Is this correct? > What does the 2nd argument do? > > -Steve > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/