Travel Planner query results in Null Response

  • 1
  • Problem
  • Updated 2 years ago
I have spent several hours trying to get a query for the travel planner to work.  I have upgraded my developer plan to anvil, and still I am unable to achieve any results using javascript/jquery.  I have other queries that have been working great for several months now, but it appears that I am missing something with this one.

I've tested my http string and it works fine in apigee, but it will not return anything when  I use it in my script.  

I've substituted my actual API Key below with "APIKEY".

<script> jQuery(document).ready(function($) {
$.ajax({
url : String("http://api.wunderground.com/api/APIKEY/geolookup/planner_10051031/q/CO/Erie.json"),
dataType : "jsonp",
success : function(parsed_json) {
var temp_high= parsed_json['trip']['temp_high']['avg']['F'];
document.getElementById('temp_high').innerHTML=fcttext1;
}
});
});
</script>
Photo of Cohbra11

Cohbra11

  • 3 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Tim Roche

Tim Roche, Official Rep

  • 259 Posts
  • 19 Reply Likes
Your API call looks fine.

Paste it in a browser to see what you get back.

one issue i see, you are setting the html of your element to fcttext1, which does not exist in this function, do you mean to set it to temp_high?
Photo of afelicioni

afelicioni

  • 227 Posts
  • 42 Reply Likes
here a working JSFiddle, including the suggestion from Tim

http://jsfiddle.net/9kbs1d53/ 
Photo of Cohbra11

Cohbra11

  • 3 Posts
  • 0 Reply Likes
Thanks, I got it working now.