N
N
NorthWind2562014-11-11 15:34:32
JavaScript
NorthWind256, 2014-11-11 15:34:32

jquery get facebook request?

Good afternoon, tell me what's wrong with the jquery request?

$.ajax({
  	url: 'https://www.facebook.com/',
  	success: function(data){
  	console.log(data);
  	},
  error: function(data){
  console.log(data);
  },
  type: "GET",
  dataType: "text"
  });

I am making a request to get the first facebook page.
Firbug console gives a message
Request from foreign origin blocked: The single origin policy prohibits reading the remote resource at https://www.facebook.com/ . This can be fixed by moving the resource to the same domain or by enabling CORS.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2014-11-11
@k12th

You seem to know how to read, since you somehow came here. What prevented you from reading this error message? The same-origin policy has been chewed up on the internet more times, perhaps, than the differences between Java and JavaScript.

N
NorthWind256, 2014-11-11
@NorthWind256

Unfortunately, I did not find a clear solution to the problem, so I wrote here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question