jmvc app served from a web server

瀏覽次數:20 次
跳到第一則未讀訊息

hau

未讀,
2010年10月26日 清晨6:30:282010/10/26
收件者: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

未讀,
2010年10月26日 上午10:21:472010/10/26
收件者: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
回覆所有人
回覆作者
轉寄
0 則新訊息