I have a function that fails in IE6 & 7 but works in Firefox Safari
(Mac) and Firefox for PC.
Of course is non-sense and offers no help. It is ''Object
doesn''t
support this property or method''. I installed Debugbar on IE7 and it
reports ''syntax error''?
Here is the function. The third line (if statement) produces the
error. The function excepts the variables col2 and col3 which are
url''s. The old content fades out, new content is grabbed from the url
and faded in. The link is not followed. However, in IE the link is
followed to the actually url instead of performing the ajax update.
I can provide a link if necessary, i just there might be something
blaring here that i am missing. my JS skills are not the best.
function getContent(col2, col3) {
element.onclick = function(){
if (this.hasClassName(''current'')) {
return false;
}
else {
new Effect.Opacity(''content'', { duration: 2, to: 0,
afterFinish:
function() {
new Ajax.Updater(''content'', col3, {
method:''get'',
onComplete:function(){
getColHeight();
new Effect.Opacity(''content'', { duration: 2, to: 1 });
}
});
}});
new Effect.Opacity(''container'', { duration: 2, to: 0,
afterFinish:
function() {
new Ajax.Updater(''container'', col2, {
method:''get'',
onComplete:function(){
getColHeight();
new Effect.Opacity(''container'', { duration: 2, to: 1
});
}
});
}});
removeClassCurrent();
this.toggleClassName(''current'');
return false;
};
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Hi,
You need to extend your elements like so:
if ($(this).hasClassName(''current''))...
More about this here: http://prototypejs.org/learn/extensions
Best,
Tobie
anathema wrote:> I have a function that fails in IE6 & 7 but works in Firefox Safari
> (Mac) and Firefox for PC.
> Of course is non-sense and offers no help. It is ''Object
doesn''t
> support this property or method''. I installed Debugbar on IE7 and
it
> reports ''syntax error''?
>
> Here is the function. The third line (if statement) produces the
> error. The function excepts the variables col2 and col3 which are
> url''s. The old content fades out, new content is grabbed from the
url
> and faded in. The link is not followed. However, in IE the link is
> followed to the actually url instead of performing the ajax update.
>
> I can provide a link if necessary, i just there might be something
> blaring here that i am missing. my JS skills are not the best.
>
>
>
> function getContent(col2, col3) {
>
> element.onclick = function(){
>
> if (this.hasClassName(''current'')) {
>
> return false;
>
> }
>
> else {
>
> new Effect.Opacity(''content'', { duration: 2, to: 0,
afterFinish:
> function() {
>
> new Ajax.Updater(''content'', col3, {
>
> method:''get'',
>
> onComplete:function(){
>
> getColHeight();
> new Effect.Opacity(''content'', { duration: 2, to: 1
});
>
>
>
> }
>
> });
>
>
> }});
>
> new Effect.Opacity(''container'', { duration: 2, to: 0,
afterFinish:
> function() {
>
> new Ajax.Updater(''container'', col2, {
>
> method:''get'',
>
> onComplete:function(){
>
> getColHeight();
> new Effect.Opacity(''container'', { duration: 2, to:
1 });
>
>
> }
>
> });
>
>
>
> }});
>
>
>
> removeClassCurrent();
> this.toggleClassName(''current'');
> return false;
> };
> }
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Hmmm... I use ''this'' in a few other places and I don''t have that problem. Is it because I passed what was being clicked on to a function so it lost track of what ''this'' was? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 28, 4:34 am, anathema <spamfreeunive...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmmm... I use ''this'' in a few other places and I don''t have that > problem. Is it because I passed what was being clicked on to a > function so it lost track of what ''this'' was?You have to extend the elements where you call any custom Prototype- methods on. Firefox extends all the objects automatically, but in IE you have to do it manually. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---