Marnen Laibow-Koser wrote:
>> It still seems to me that it is. Where there is html, there can be
>> javascript.
>
> Yes. There can also be CSS. There *should* be neither.
WHY!???!? You want to make web programming *more* limited that it
already is??
I agree "when convienient" but
> Rather what I'm talking about is simply having <div class="menu"></div>
> in your HTML, then do something like
>
> window.onload = function () {
1) what if this menu is part of a view being loaded into an existing
div, and not part of a fresh page
2) create_menu_div would imply (or at least, I would hope) to me
something a little bit more significant than just assigning some style.
I do use a function like this, and it takes an array of choices (for the
menu options) and a callback containing a switch(); the number of the
choice corresponds to this, so rather than having to write a slew of
onclick statements, etc,
choices = ["do this", "do that", "do both"];
create_menu_div(style, choices, parnt, callback);
>> Also, using an event handler still
>> entails putting some javascript in an html page somewhere.
>
> Not necessarily. You can use the onload technique (as above) to assign
> behavior without a single JS call in the HTML. All you need is the
> external <script> tag in the <head>.
The <head> I would say is part of an html page.
> It's not a paradox at all. It's perfectly feasible, and I know because
> I have done it.
Yeah, because you use ruby shortcuts. The JS still ends up in the page.
All you have to do is look at the source generated for a rails app page
(any and all of them) to find more inline javascript than you can shake
a stick at.
> Again: it is possible. It is feasible. It's not even particularly
> difficult.
Sure, and again I agree: as convenient. By "not possible" I meant that
I sincerely hope that people with your opinion do not come up with a
means of *forcing* everyone else to comply, and I do believe that "will
not be possible", in fact. Thankfully.
-MK
ps. with your penchant for waving credentials and experience, the
biggest question in my mind would be why the simple answer Rob gave was
evidently out of your range...
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---