Question: It could be I have completely misunderstood how web services work. 

So there's a webservice I want to access through a javascript file sitting in a folder on my desktop. The server I am trying to access has not set a CORS header, so I have some trouble just using regular ol' ajax. 

And frankly I am not sure where to go from here. 

```
$.ajax({
    type:"get",
    crossdomain: "true",
    url: "https://name", //actual name redacted from this question 
    success: function(data){
        console.log(data);
    }
});

```

A regular get like this will print the following in firefox's console.

```
  Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ws.zooom.no/v1/channels. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

```

I got a hint from the task giver that I need to set the following in my "hosts file"

```
#127.0.0.1  www.domainname.com

```

Which confuses me. I have little to no experiences hosting anything, but does this hint that I need to maybe virtually host my "webpage" to access the webservice? It probably doesn't help to say I feel at a loss here.

Answer: 
So the bad news is that unless the 3rd party service either allows cross-domain requests (this is a configuration on that 3rd party server), or allows JSONP requests, you really have no option to access this service using a browser and javascript.

You could perhaps build your own service to proxy requests to that third party service. This would give you control over domain, CORS, JSONP, etc.
I found a solution.

Using something called "JSONP" that I had never heard of until now, i wrote a request like this

```
$.ajax({
   type: 'GET',
    url: "https://DOMAINNAME.com",
    contentType: "application/json",
    dataType: 'jsonp',
    success: function(data) {
        console.log(data)
    },
    error: function(e) {
       console.log(e.message);
    }
});

```

This somehow completely negated the CORS problems