So I am trying to do a little bit polling for my rails app using jQuery's getScript() function. Here are my codes:
script file
function updatePredictionResults() {
$.getScript("/predictions/pollAllResults.js?task_id=" + task_id + "&omim_id=" + omim_id);
}
This script, should call an action (pollAllResults) in the prediction controller, then render and execute the codes in pollAllResults.js.erb file. It works perfectly in development mode when testing using rails server.
However, when I deployed my app using Phusion Passenger along with Apache, getScript() function seems not working - neither the code in the controller or in the following javascript file is executed. There is also no error logs generated from the server. Anyone knows why? Many thanks!
Update:
Now I seem to know what the problem is - this is found in apache log:
"GET /predictions/pollAllResults.js?task_id=1363034126&omim_id=180860&_=1363034264908 HTTP/1.1" 404 227
I don't know why this is happening... Strangely, even when I access this url directly, the javascript can be fetched and load..., but it keeps giving me 404...