Re: Safari 3 beta, tab object and AppleScript
Re: Safari 3 beta, tab object and AppleScript
- Subject: Re: Safari 3 beta, tab object and AppleScript
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 13 Jun 2007 08:57:42 -0400
The "class" attribute of DOM objects has always been "className" when
accessed as a JavaScript object member. If at some point some JS
implementation had a synonym for it such that "['class']" worked, that
was an implementation-specific extension. (The attribute syntax
version "obj.class" can't work in a compliant implementation, since
"class" is a reserved word.)
However, getAttribute("class") should also work, and
getAttribute("className") would return the value of any actual
"className" attribute.
On 6/13/07, Emmanuel <email@hidden> wrote:
At 1:39 PM +0200 6/13/07, jj wrote:
>This one is trying to locate and innerHTML the contents of a TD
class="tip1"
>and bgcolor="#A3947D". It worked before and it doesn't now.
>
>So, I must replace now:
>
>x[i]['class']
>
>With:
>
>x[i].getAttribute('class')
>
>Most probably there are more cases, but now I don't have the time to check
>it all ;-))
I'm not a specialist, but I think that neither ["class"] nor
getAttribute("class") has ever been legal. I thought that what was
legal has always been .className (or: ["className"]). I thought that
the reason for that is that "class" is a reserved word for JS.
Got more broken scripts?
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden