Sébastien Grosjean - ZenCocoon
2007-Mar-06 14:15 UTC
How to set the attribute "name" to an element "iframe" to work with IE ?
Hi all,
How to set the attribute "name" to an element "iframe" to
work with
IE ?
I actually tried few ways, like :
this.iframe.name = "iframe-name";
or
this.iframe.setAttribute(''name'',
''iframe-name'');
but no one seems to work properly on IE (IE 7 at least).
--
Sébastien Grosjean - ZenCocoon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Tom Gregory
2007-Mar-06 15:42 UTC
Re: How to set the attribute "name" to an element "iframe" to work with IE ?
In IE, the name element may only be set at creation time for elements
created w/ createElement.
var inp = document.createElement(''input'');
inp.name = ''foo''; //Won''t work in IE.
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/
dhtml/reference/properties/name_2.asp
Using innerHTML or Microsoft''s propriety version of createElement
will work:
try {
// First try the IE way; if this fails then use the standard way
element = document.createElement(''<input
name="foo">'');
} catch (e) {
// Probably failed because were not running on IE
}
if (!element) {
element = document.createElement(''input'');
element.name = ''foo'';
}
TAG
On Mar 6, 2007, at 7:15 AM, Sébastien Grosjean - ZenCocoon wrote:
>
> Hi all,
>
> How to set the attribute "name" to an element "iframe"
to work with
> IE ?
>
> I actually tried few ways, like :
>
> this.iframe.name = "iframe-name";
>
> or
>
> this.iframe.setAttribute(''name'',
''iframe-name'');
>
> but no one seems to work properly on IE (IE 7 at least).
> --
> Sébastien Grosjean - ZenCocoon
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Sébastien Grosjean - ZenCocoon
2007-Mar-06 17:40 UTC
Re: How to set the attribute "name" to an element "iframe" to work with IE ?
Hi Tom, Awesome ! Thanks for this trick and link. -- Sébastien Grosjean - ZenCocoon On Mar 6, 5:42 pm, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> In IE, the name element may only be set at creation time for elements > created w/ createElement. > > var inp = document.createElement(''input''); > inp.name = ''foo''; //Won''t work in IE. > > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/ > dhtml/reference/properties/name_2.asp > > Using innerHTML or Microsoft''s propriety version of createElement > will work: > > try { > // First try the IE way; if this fails then use the standard way > element = document.createElement(''<input name="foo">''); > } catch (e) { > // Probably failed because we''re not running on IE > } > if (!element) { > element = document.createElement(''input''); > element.name = ''foo''; > } > > TAG > > On Mar 6, 2007, at 7:15 AM, Sébastien Grosjean - ZenCocoon wrote: > > > > > Hi all, > > > How to set the attribute "name" to an element "iframe" to work with > > IE ? > > > I actually tried few ways, like : > > > this.iframe.name = "iframe-name"; > > > or > > > this.iframe.setAttribute(''name'', ''iframe-name''); > > > but no one seems to work properly on IE (IE 7 at least). > > -- > > Sébastien Grosjean - ZenCocoon--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---