I'm not saying it's the best solution, but this code works for me in
FF, IE6, IE7 and Opera:
<script type='text/javascript'>
function go () {
$("select").remove();
}
Event.observe(window, 'load', function () {
$('select').removeOption = $('select').remove;
$('select').remove = Element.remove.methodize();
$('select').removeOption(0);
});
</script>
<a href='javascript:go()'>run</a>
<select id='select' name='browser'>
<option value='ie'>IE</option>
<option value='ff'>FireFox</option>
<option value='o'>Opera</option>
</select>
It is obviously not exactly how it would work in the prototype
library, but it shows that the function can be successfully aliased
and changed.
On Jan 30, 12:10 pm, "Justin Perkins" <[EMAIL PROTECTED]> wrote:
> On Jan 30, 2008 2:03 PM, Nycto <[EMAIL PROTECTED]> wrote:
>
> > Another might be to rename the native remove function and replace it
> > with the Prototype method.
>
> I'm not positive, but I think that would be a no-go in IE.
>
> -justin
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---