TweeZz
2008-Feb-14 15:29 UTC
$(''someElement'').insert(new Element(''img'')) not working in IE6 / IE7
Hi,
I have this code:
_path.insert(getPathImage());
getPathImage looks like this:
ffunction getPathImage()
{
// VERSION 1
// return
String.format(" <img
alt=''''
src=''{0}img/controls/path/pathcontrol-arrow.png'' />
",
getApplicationPath());
//
// VERSION 2
// return new Element(''img'', {
// alt:'''',
// src:String.format(''{0}img/controls/path/pathcontrol-
arrow.png'', getApplicationPath())
// }).setStyle({paddingLeft:''15px'',
paddingRight:''2px''});
//
// VERSION 3
// return new
Element(''img'').writeAttribute(''src'',
getApplicationPath() +
''img/controls/path/pathcontrol-arrow.png'');
//
// VERSION 4
return new Element(''img'');
}
VERSION 1 --> 4 work fine in FF and opera. In IE6 and IE7, only
VERSION 1 works.
Did I bump into a bug in prototype? I''m using version 1.6.0.2. It
looks that somehow IE fails in inserting an img object created using
''new Element(...)''
Did anyone experience similar problems? Am I doing something wrong?
Kind regards,
Manu.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
David Lam
2008-Feb-14 17:25 UTC
Re: $(''someElement'').insert(new Element(''img'')) not working in IE6 / IE7
is it saying "Invalid Source HTML for this operation."?? On Thu, Feb 14, 2008 at 7:29 AM, TweeZz < manu.temmermanuyttenbroeck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I have this code: > _path.insert(getPathImage()); > > > getPathImage looks like this: > > ffunction getPathImage() > { > // VERSION 1 > // return String.format(" <img > alt='''' src=''{0}img/controls/path/pathcontrol-arrow.png'' /> ", > getApplicationPath()); > // > // VERSION 2 > // return new Element(''img'', { > // alt:'''', > // src:String.format(''{0}img/controls/path/pathcontrol- > arrow.png'', getApplicationPath()) > // }).setStyle({paddingLeft:''15px'', paddingRight:''2px''}); > // > // VERSION 3 > // return new Element(''img'').writeAttribute(''src'', > getApplicationPath() + ''img/controls/path/pathcontrol-arrow.png''); > // > // VERSION 4 > return new Element(''img''); > } > > VERSION 1 --> 4 work fine in FF and opera. In IE6 and IE7, only > VERSION 1 works. > Did I bump into a bug in prototype? I''m using version 1.6.0.2. It > looks that somehow IE fails in inserting an img object created using > ''new Element(...)'' > > Did anyone experience similar problems? Am I doing something wrong? > > Kind regards, > Manu. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
TweeZz
2008-Feb-14 20:40 UTC
Re: $(''someElement'').insert(new Element(''img'')) not working in IE6 / IE7
IE6 / IE7 didn''t throw any exception for me.. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
TweeZz
2008-Feb-15 08:09 UTC
Re: $(''someElement'').insert(new Element(''img'')) not working in IE6 / IE7
Although I have a working version, I would like to understand what''s
going on.
When I run the following code in IE, opera or FF, the alert box shows
me: "<img>".
img = new Element(''img'');
img = img.wrap(''div'');
alert(img.innerHTML);
Could it be that IE somehow has problems with the fact that it''s not
"<img />"?
When I look in the source code, IE doesn''t render any "img"
tag. FF
and Opera do.
It''s hard to imagine nobody else had this issue. I will try to google
it a little longer.
I would still appreciate some help though... kangax? :)
Manu.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---