jmvc app served from a web server

Skip to first unread message


Oct 26, 2010, 6:30:28 AM10/26/10
to JavaScriptMVC
I'm doing development work for a web app using jmvc3. My app will use
ajax to fetch data from a server. The design will have these remote
resources coming from a domain different from the app itself. So,
we'll use a browser that supports CORS and have the remote server also
providing that support.

In development mode, I point my browser to a file:/// url of the app.
It then calls ajax to a remote server which returns data in json.
That's fine. But when data comes back, the javascript breaks with
this error when it tries to render a view:

XMLHttpRequest cannot load file:///Users/hau/lab/jmvc3/myapp/views/reading/page.ejs.
Origin null is not allowed by Access-Control-Allow-Origin.

I did some search on the web and it looks like the reason of this
error is because the app is served at a file:/// url. Supposedly this
can be solved by access the app at a http url.

So, my question is: how can a jmvc3 app in development mode be
deployed on a web server? I'd appreciate anyone's sharing some
success stories on this. It would be even better if the web server is
a rails app, i.e. rails app; app/script/server to bring up the
server. Thanks!

Brian Moschel

Oct 26, 2010, 10:21:47 AM10/26/10
Hey Hau,

Can you repost this on the new forum at ?


You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Brian Moschel

Jupiter Consulting
Reply all
Reply to author
0 new messages