8184239: Fix broken nashorn/samples

Fixed broken nashorn samples

Reviewed-by: sundar, hannesw, jlaskey
This commit is contained in:
Srinivas Dama 2017-07-13 16:51:45 +05:30 committed by Srinivas Dama
parent aaf6826eb5
commit 831355e8b3
3 changed files with 3 additions and 2 deletions

View File

@ -60,7 +60,7 @@ function readTextFromURL(url) {
}
// change URL for your city here!
var url = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json";
var url = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json&appid=9b2982987c080ae88d81f081dcb129e8";
// download JSON document and parse
var json = readTextFromURL(url);

View File

@ -37,6 +37,7 @@ if (! $OPTIONS._fx) {
}
load("fx:controls.js");
var Scene = Java.type("javafx.scene.Scene");
function start(stage) {
var picker = new DatePicker();

View File

@ -103,7 +103,7 @@ function treeItemForObject(obj, name) {
return item;
}
var DEFAULT_URL = "http://api.openweathermap.org/data/2.5/forecast/daily?q=Chennai&mode=json&units=metric&cnt=7`";
var DEFAULT_URL = "http://api.openweathermap.org/data/2.5/forecast?q=chennai,india&units=metric&mode=json&appid=9b2982987c080ae88d81f081dcb129e8";
var url = arguments.length == 0? DEFAULT_URL : arguments[0];
var obj = JSON.parse(readTextFromURL(url));