But, it looks like this code is being generated but not actually run: if
i run the contents of the try block in the console then it does what
it's supposed to do. Can anyone explain what's going on here?
You need to specify the type option as "script" to have it executed.
(See the docs for jQuery.ajax(), where it is the dataType option. The
"type" option in $.post is passed to $.ajax as the dataType option)
You need to specify the type option as "script" to have it executed.
(See the docs for jQuery.ajax(), where it is the dataType option. The
"type" option in $.post is passed to $.ajax as the dataType option)
Thanks Rein, that was exactly it: using .ajax instead of .post worked
perfectly:
//doesn't evaluate the response, ie doesn't run the javascript in my
.js.rjs file
jQuery.post("/plans/<%= @plan.id %>/add_learning_objective?name=" +
objective_name);