jmvc app served from a web server

20 views
Skip to first unread message

hau

unread,
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

unread,
Oct 26, 2010, 10:21:47 AM10/26/10
to javasc...@googlegroups.com
Hey Hau,

Can you repost this on the new forum at http://forum.javascriptmvc.com/ ?

Thanks,
Brian


--
You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to javasc...@googlegroups.com.
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.




--
Brian Moschel

Jupiter Consulting
\Development\Training\Support
847-727-1609
brian....@gmail.com
Reply all
Reply to author
Forward
0 new messages