Created
October 30, 2014 13:00
-
-
Save WebRTCGame/e4b3d0b0f1fe11c2b61e to your computer and use it in GitHub Desktop.
Borrow Content Cross-origin from a website
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="queryResultContainer">abc</div> | |
<script> | |
var ExternalURL = "www.reptilesmagazine.com/Reptile-Events-Calendar/"; | |
$(document).ready(loadContent); | |
function loadContent() { | |
var QueryURL = "http://anyorigin.com/get?url=" + ExternalURL + "&callback=?"; | |
$.getJSON(QueryURL, function (data) { | |
console.log(data); | |
var element = document.getElementById("queryResultContainer"); | |
var html = $.parseHTML(data.contents); | |
html = $(html).find('#calendar-listings').html(); | |
element.innerHTML = html; | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment