Question

Unable to fetch google feed; it's not loading.It's working fine in the browser omitting the phonegap libraries etc.Kindly help, here is the code.-

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height    attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1,   minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Testly</title>
</head>
<body>
<div class="app">
<h1>PhoneGap</h1>
<div id="deviceready" class="blink">
<a href="#" onclick="var ref = window.open('http://cnn.com', '_blank',   'location=yes,toolbar=yes');">CNN Link</a>
</div>
<div class="f">loading...</div>
<script type="text/javascript" src="phonegap.js"></script>
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
document.addEventListener("backbutton", function (e) {
e.preventDefault();
}, false );
} </script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">                               /*feed control*/
google.load("feeds", "1", {'nocss' : 1});
function OnLoad() {
var feedControl = new google.feeds.FeedControl();
feedControl.setNumEntries(25);
feedControl.addFeed("http://feeds.feedburner.com/Techcrunch");
feedControl.draw(document.querySelector(".f"));
}
google.setOnLoadCallback(OnLoad);
</script>
<style>
.f{
margin:20px;
overflow:scroll;
width:400px;
height:400px;
}
</style>
<script type="text/javascript">
app.initialize();
</script>
</body>
</html>

It is unable to load feeds, evrything else is working fine.

Was it helpful?

Solution

Thanks for your help @Drew @divoto. Checked with firebug and whitelisted all the possible domains; that were previously not whitelisted. Here's the list-

 <access origin="*.google.com" />
  <access origin="*.googleapis.com" />
  <access origin="*.gstatic.com" />
  <access origin="*.googleusercontent.com" />
  <access origin="google.com" subdomains="true"/>
  <access origin="googleapis.com" subdomains="true"/>
  <access origin="gstatic.com" subdomains="true"/>
  <access origin="googleusercontent.com" subdomains="true"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top