出于某种原因,我在这段代码中的某处获得SyntaxError: unexpected POST_IF
。有任何想法吗? -
$('.provider-fields').hide()
switch parseInt($('#referral_provider_type').val())
when window.AIDIN.provider_types.hha
$('.hha-fields').show()
when window.AIDIN.provider_types.snf
$('.snf-fields').show()
$("#length_of_stay").show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.snf_radius
when window.AIDIN.provider_types.ltac
$('.ltac-fields').show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.ltac_radius
when window.AIDIN.provider_types.pd
$('.pd-fields').show()
when window.AIDIN.provider_types.irf
$('.irf-fields').show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.irf_radius
$('#referral_provider_type').live 'change', (e) ->
$('.provider-fields').hide()
$('input[type="checkbox"][name*="referral[referral_care_types_attributes]"]').attr("checked", false)
switch parseInt($('#referral_provider_type').val())
when window.AIDIN.provider_types.hha
$('.hha-fields').show()
when window.AIDIN.provider_types.snf
$('.snf-fields').show()
$("#length_of_stay").show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.snf_radius
when window.AIDIN.provider_types.ltac
$('.ltac-fields').show()
if $( ("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.ltac_radius
when window.AIDIN.provider_types.pd
$('.pd-fields').show()
when window.AIDIN.provider_types.irf
$('.irf-fields').show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.irf_radius
答案 0 :(得分:2)
缩进问题如下所示:
switch parseInt($('#referral_provider_type').val())
when window.AIDIN.provider_types.hha
$('.hha-fields').show()
when window.AIDIN.provider_types.snf
$('.snf-fields').show()
$("#length_of_stay").show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.snf_radius
when window.AIDIN.provider_types.ltac
$('.ltac-fields').show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.ltac_radius
when window.AIDIN.provider_types.pd
$('.pd-fields').show()
when window.AIDIN.provider_types.irf
$('.irf-fields').show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.irf_radius
$('#referral_provider_type').live 'change', (e) ->
$('.provider-fields').hide()
$('input[type="checkbox"][name*="referral[referral_care_types_attributes]"]').attr("checked", false)
switch parseInt($('#referral_provider_type').val())
when window.AIDIN.provider_types.hha
$('.hha-fields').show()
when window.AIDIN.provider_types.snf
$('.snf-fields').show()
$("#length_of_stay").show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.snf_radius # <----- Here
when window.AIDIN.provider_types.ltac
$('.ltac-fields').show()
if $( ("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.ltac_radius # <-------Here
when window.AIDIN.provider_types.pd
$('.pd-fields').show()
when window.AIDIN.provider_types.irf
$('.irf-fields').show()
if ( $("#regular").hasClass('active') )
$("#search_radius").show()
if ( $("#search_radius input").val() == '' )
$("#search_radius input").val window.AIDIN.radii.irf_radius # <---------Here