Skip to content

Instantly share code, notes, and snippets.

@xinmyname
Created July 26, 2011 16:03
Show Gist options
  • Save xinmyname/1107109 to your computer and use it in GitHub Desktop.
Save xinmyname/1107109 to your computer and use it in GitHub Desktop.
Beauty is in the eye of the beholder, or something...
testScadaTag = ->
$("#tagTest").attr("src", "/Content/blank.gif");
if (viewModel.scadaTag())
$("#tagTest").attr("src", "/Content/smallSpinner.gif")
$.ajax
url: "/Scada/Test/#{viewModel.scadaTag()}"
type: 'POST'
dataType: 'json'
error: (jqXHR, textStatus, errorThrown) ->
$("#tagTest").attr("src", "/Content/fail.png")
success: (data, textStatus, jqXHR) ->
$("#tagTest").attr("src", "/Content/ok.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment