Over a million developers have joined DZone.

Cross Domain Calls in jQuery

DZone's Guide to

Cross Domain Calls in jQuery

· Big Data Zone ·
Free Resource

How to Simplify Apache Kafka. Get eBook.

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!
    url: 'http://news.bbc.co.uk',
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('a.tsh').text();
// Works with $.get too!

12 Best Practices for Modern Data Ingestion. Download White Paper.


Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}