1

I am using ajax to get cross domain data.

Due to browser security restrictions, most Ajax requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol (Details) .

So i am using YQL https://code.tutsplus.com/tutorials/quick-tip-cross-domain-ajax-request-with-yql-and-jquery--net-10225 to get html data.

My question is how to make call using external proxy server. For example https://www.pinterest.com/ , so i am using external proxy server with direct url access like https://www.filterbypass.me/s.php?k=https://www.pinterest.com/ .

But the problem is yql query return to null, no response data.

$.ajax({
    url: 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from html where url="https://www.filterbypass.me/s.php?k=https://www.pinterest.com/"') + '&format=json&diagnostics=true&callback=',
    dataType: 'json' ,
    success: function(data) {
     console.log(data);
    }
 });
Community
  • 1
  • 1
hurr
  • 11
  • 3

1 Answers1

0

If you are planning to use JSONP you can use getJSON which made for that. jQuery has helper methods for JSONP

$.getJSON( 'http://someotherdomain.com/service.php', function( result ) {
       console.log(result);
});

Read the below links

http://api.jquery.com/jQuery.getJSON/

Basic example of using .ajax() with JSONP?

Community
  • 1
  • 1
jay.jivani
  • 1,560
  • 1
  • 16
  • 33