Sha256: be4968225213a7fc08b61474b76361efe1c6bdac5130372803cbe31734f61a28

Contents?: true

Size: 605 Bytes

Versions: 1

Compression:

Stored size: 605 Bytes

Contents

<% if xhr?
  $rig.lo = params['freq'].to_f
  @response.body = [$rig.lo.to_s]
  @response.headers['Content-Type'] = 'text/plain'
end -%>
<form action="lo" id="freqForm">
  <input type="text" name="freq" value="<%= $rig.lo %>" %>
</form>
<script type="text/javascript">
  $("#freqForm").submit(function(event) {
    event.preventDefault(); 
    var $form = $( this ),
        term = $form.find( 'input[name="freq"]' ).val(),
        url = $form.attr( 'action' );
    $.post( url, { freq: term },
      function( data ) {
        $form.find( 'input[name="freq"]' ).val(data)
      }
    );
  });  
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radio-0.0.2 www/lo.erb