Forum: Ruby on Rails Custom JS breaking in IE6,7 - Tips on debugging?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ram (Guest)
on 2009-05-15 14:42
(Received via mailing list)
Hi all,

I just got around to testing my application in IE6 and 7 and I
discovered that my custom Javascripts dont work and seem to break the
HTML and CSS in the page too.

Any tips or resources that I can read up to make my JS IE compatible?
Your experiences and thoughts? I coudl post some of my code here if
anyone could help me with it.

Hope to get some pointers.. Thanks!
Ram (Guest)
on 2009-05-15 15:51
(Received via mailing list)
This is the smallest piece of custom JS thats NOT working. Is the
method of DOM reference im using wrong? Im using the this.up and
this.down methods all over my custom JS.

Ruby/Rails code

<h4>Filter Tickets</h4>
       <p>Filter tickets by status.</p>
    <form id='filter' class='filter' action="/tickets" method="get">
          <p>
            <%= hidden_field_tag :commit, "Filter"%>
      <%= select_tag "status", options_from_collection_for_select
(Status.find(:all), :id, :status,selected_status(params
[:status])), :onchange => "this.up('.filter').submit()" %>
    </p>
                </form>

Resulting HTML page source

<h4>Filter Tickets</h4>
  <p>Filter tickets by status.</p>
    <form id='filter' class='filter' action="/tickets" method="get">
  <p>
  <input id="commit" name="commit" type="hidden" value="Filter" />
  <select id="status" name="status" onchange="this.up('.filter').submit
()"><option value="1">Open</option>
<option value="2">Accepted</option>
<option value="3">In Progress</option>
<option value="4">Completed</option>
<option value="5" selected="selected">All</option>
<option value="6">Invalid</option></select>
  </p>
    </form>
  </p>

HELP!
Matt J. (Guest)
on 2009-05-16 19:08
(Received via mailing list)
I seem to recall that not all JS implementations return Prototype-
extended objects. Try using $(this) instead.

--Matt J.
This topic is locked and can not be replied to.