Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Cross Domain Calls in jQuery

DZone's Guide to

Cross Domain Calls in jQuery

· Big Data Zone
Free Resource

Effortlessly power IoT, predictive analytics, and machine learning applications with an elastic, resilient data infrastructure. Learn how with Mesosphere DC/OS.

Cross Domain Call in jQuery 

We needed to be able to call a web site in client side from another domain address. We fixed this with combination of a custom jQuery plugin and YQL (Yahoo Query Language). You can find more information in here.

Client code will be like below:

$('#container').load('http://google.com'); // SERIOUSLY!
  
$.ajax({
    url: 'http://news.bbc.co.uk',
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('a.tsh').text();
        alert(headline);
    }
});
  
// Works with $.get too!

Learn to design and build better data-rich applications with this free eBook from O’Reilly. Brought to you by Mesosphere DC/OS.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}