Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why isn't my jQuery.get() callback being called?
  2. $(function () {
  3.     function show_status() {
  4.          $.get("<%= status_jobs_path -%>",
  5.                function(data) {
  6.                    $('#job-status').html('hi mom');
  7.                }, 'json');
  8.     }
  9.     show_status();
  10. });
  11.        
  12. $(function () {
  13.     function show_status() {
  14.         $('#job-status').html('hi mom');
  15.     }
  16.     show_status();
  17. });
  18.        
  19. render :json => { :message => "Hi mom" }, :status => :ok