As I work on developing a basic watchface for Pebble, I'm encountering a JavaScript error that's giving me some trouble.
The data is being sourced from
Here's a snippet of the code:
function HTTPGET(url) {
var req = new XMLHttpRequest();
req.open("GET", url, false);
req.send(null);
return req.responseText;
}
var getWeather = function() {
var lhs1 = "usd";
var rhs1 = "jpy";
var url1 = "rate-exchange.appspot.com/currency?from=" + lhs1 + "&to=" + rhs1
console.log(url1);
var response1 = HTTPGET(url1);
var json1 = JSON.parse(response1);
and so forth. The issue arises with the following error message:
[PHONE] pebble-app.js:?: JS: where.is.spot: rate-exchange.appspot.com/currency?from=usd&to=jpy
[PHONE] pebble-app.js:?: Error: where.is.spot: Invalid URL at line 4 in pebble-js-app.js
This problem occurs at line 4 specifically: req.send(null);
Any thoughts on what might be causing this error? Everything seems fine with the data feed.