Hi all!
I''ve been developing a new site with scriptaculous for about a month
now, and really enjoying it. Things have been going mostly smoothly.
Today I tried to use the Highlight effect for the first time, and I
just couldn''t get it to work. I tried multiple versions of
scriptaculous and prototype, including the current SVN trunk.
I was using FireFox 1.0.6 in OS X 10.4.2, and this code:
> Effect.Highlight(obj);
produced this error:
> Error: this.initialize has no properties
> Source File: file:///Users/avi/Documents/Dev/WordPress%20theme/js/
> lib/prototype-1.4.0_pre7.js
> Line: 23
The thing is, it works fine in the Wiki demo page -- why not in my
page? So I looked at the source for the demo page, and saw this:
> <div class="example" id="demo-effect-highlight"
onclick="new
> Effect.Highlight(this)">
Aha! This used the *new* statement, my code didn''t. A quick change
and test and my page now works fine.
So, my problem is solved. However, I''d like to help ensure that other
people can avoid this problem.
It''s odd that the Wiki page "Usage" *does not* use *new*, but
the
demo page code *does*. It makes me wonder what''s the actual official
recommended syntax. To new or not to new?
If *new* is recommended, then perhaps the Usage page should be
updated to reflect that. If *not*, then perhaps the demo page code
should be revised to remove the *new* statement - and if that''s the
case, then it may just be a bug, that Highlight requires the *new*
statement and other effects do not.
Hope that made sense.
Thanks!
Avi Flax
Baltimore, Maryland, USA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2359 bytes
Desc: not available
Url :
http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050928/43284523/smime.bin