Please help guys, This one is a major BLOCKER!
I have a project that uses NodeJS + jQuery Form Plugin + Typescript in which I am trying to do a file
Are you asking why am I getting the error:
XMLHttpRequest cannot load localhost/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8080' is therefore not allowed access.
If so then what you need on your localhost server (assuming that is also Node) is a header set on the response from localhost
to allow the Origin of localhost:8080
to access this resource like this:
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8080');
Or perhaps you are actually trying to request from the same server but forgot that 8080 is your test server: if so then in your test you should list your URL as
$.ajax("http://localhost:8080", { //....
or to repeat the current origin:
$.ajax( window.location.origin,{ // ....
Your last alternative to avoiding this (if you can't set the Origin policies on the response) is to use a jsonp
service which is less strict but also less featured, but that's not appropriate for your task so I won't go into that.
Either way once you get past the Origin policy you'll have other hurdles as @zeroflagL mentions. Here's a method that might suit you: How to handle cross domain iframe file upload json response?