i would like to create a dynamic iframe who will show a random URL from a specific Feed i was able to make it once it worked fo a while but stopped working and wasn't able to make it work back anymore.
Here is the code below :
<script>
function GetContent(feedUrl) {
var feedApiGetJSON = 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=15&callback=?&q=';
jQuery.ajax({
url: feedApiGetJSON + feedUrl,
dataType: 'jsonp',
jsonpCallback: 'JsonpCallback'
});
}
function JsonpCallback(data) {
if (data.responseStatus == "200") {
//alert(data.responseData.feed.title);
var e = Math.floor(Math.random() * data.responseData.feed.entries.length + 1);
jQuery("#iframe_url").attr("src", data.responseData.feed.entries[e].link);
}
}
jQuery(document).ready(function () {
GetContent("http://bit.ly/1SyQdL0");
});
<iframe id="iframe_url" src="" style="border: 0px;height: 800px;width: 600px"></iframe>
Thanks For Help