title: Get undefined javascript function in IE 11
body: <p>I got some error when call function in IE 11. In my case I have two scripts inside one <code>&lt;script&gt;</code> tag.</p>
  
  <p>This is my function :</p>
  
  <pre><code>&lt;script&gt;
  function test()
  {
      alert("oke");
      var currency = $('#curr_drop').val();
      var total_room_qty = calculate_amount(currency); // total all room
  
      var btn_class = $('#book_button').prop('class');
  
      var this_qty = $(this).val();
      var this_plan_type = $(this).data('plan-type');
      var this_plan_id = $(this).data('plan-id');
      var this_plan_day = $(this).data('plan-day');
  }
  
  function calculate_amount(currency = 'IDR') 
  {
      //alert("ok");
      var nights = $('[name="nights"]').val();
      var total_amount = 0; var total_room_qty = 0; var total_qty_room_id = 0;
  
      console.log('nights: '+nights);
  
  
      return total_room_qty;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I call that <code>test</code> function from this code :</p>
  
  <pre><code>&lt;select name="qty" class="mb10" onchange="test.bind(this)()" data-plan-type="rate" data-plan-id="38" data-plan-day="52459"&gt;
     &lt;option value="0"&gt;0 rooms&lt;/option&gt;
     &lt;option value="1"&gt;1 rooms&lt;/option&gt;
     &lt;option value="2"&gt;2 rooms&lt;/option&gt;
     &lt;option value="3"&gt;3 rooms&lt;/option&gt;
     &lt;option value="4"&gt;4 rooms&lt;/option&gt;
     &lt;option value="5"&gt;5 rooms&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>My problem is when I tried to show <code>alert</code> in top of function <code>test</code> I got <code>undefined function test</code> but if I close <code>var total_room_qty = calculate_amount(currency); // total all room</code> the alert can be shown in IE 11 browser. How it could be happen and how to I fix this ? Thanks</p>