Forums

javascript problem?

I have an app I've written in js (it uses moment.js which has non latin characters).

Serving it on my local machine using SimpleHTTPServer, the build file runs (the browser can't access the api because of CORS), but when I put the same file on pythonanywhere it doesn't run.

The same problem with github pages.

  • There are no errors in the console
  • the javascript file appears in source

Am I doing something really stupid not having the js run when served offsite, or does this have to do with UTF-8, or something else?

garthbeetle.pythonanywhere.com/ojclient/ is the site

please help!

and thanks in advance.

just to clarify, have you written js for the frontend? or actually written a nodejs backend webapp?

how have you been trying to get the webapp setup on pythonanywhere? have you tried creating a webapp on the webapps tab yet?

no, javascript is only frontend.

It is a static file being served by the python anywhere static file server in the 'web' menu

There is django-rest-framework backend.

I can confirm that page just seems to be blank, and there are no js errors, and no network errors... I can't think of anything obvious that would be causing problems though? Can you add some console.logs to debug?

I solved this issue - it had to do with using react-router which requires the server to have a wild card address so all URL manipulation done by react-router doesn't affect the app.

Using hashHistory instead of browserHistory solved the issue.

Thanks all for your help

I can't understand that

Perhaps your problem is something different? I see that you've posted on another forum thread so I'll answer there.