RailsCasts Pro episodes are now free!

Learn more or hide this

John Harper's Profile

GitHub User: jhnhrpr

Site: http://johnharper.me

Comments by John Harper


It appears that this was an issue with console.log, which I now realize wasn't intended to be in the final version of the code. When IE's "F12 Developer Tools" feature was enabled, the dynamic select menus worked as intended. I removed both instances of console.log from the coffeescript file and the issue is gone, with and without F12 Developer Tools enabled. Gotcha on me.

More on this here: http://stackoverflow.com/questions/11346091/i-e-craches-my-js-script-at-first-then-i-press-f12-and-it-works-beaultifully?lq=1


And the html...

<div class="row" id="preferred_performance_row">
  <select id="order_preferred_performance_id" name="p">
    <option value=""></option>
    <option value="1">Friday, 11/23/2012 -  2:00 pm</option>
    <option value="2">Friday, 11/23/2012 -  5:30 pm</option>
<div id="preferred_ticket_level_row">
  <select id="order_preferred_ticket_level_id" name="tl">
    <option value=""></option>
    <optgroup label="Friday, 11/23/2012 -  2:00 pm">
      <option value="1">Orch 1 - $66.00</option>
      <option value="2">Orch 2 - $46.00</option>
    <optgroup label="Friday, 11/23/2012 -  5:30 pm">
      <option value="3">Orch 1 - $66.00</option>
      <option value="4">Orch 2 - $46.00</option>

This isn't working for me in Internet Explorer 9...Changing the first select menu doesn't do anything. The second select menu remains hidden.

Chrome on Windows, and Safari, Firefox, and Chrome on OS X work fine. Any gotchas that you've found?

jQuery ->
  loaded_ticket_level = $('#order_preferred_ticket_level_id :selected').text()
  if loaded_ticket_level.length < 1
  ticket_levels = $('#order_preferred_ticket_level_id').html()

  $('#order_preferred_performance_id').change ->
    performance = $('#order_preferred_performance_id :selected').text()
    escaped_performance = performance.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1')
    options = $(ticket_levels).filter("optgroup[label=#{escaped_performance}]").html()
    if options