【发布时间】:2018-04-24 18:30:53
【问题描述】:
我想制作一个网络应用,根据他们选择的位置的天气生成一套服装。
这是我目前所拥有的:https://codepen.io/anchpags/pen/bMpjxX
<html>
<head>
<link rel="stylesheet" href="http://toolness.github.io/weather-outfit-fun/weather-outfit.css">
<script src="http://toolness.github.io/weather-outfit-fun/weather-outfit.js"></script>
<script>
function getForecastOutfit(forecast) {
if (forecast.temp.f > 0) {
return "http://some/picture";
}
return "http://toolness.github.io/weather-outfit-fun/img/eskimo-lomen-1915.jpg";
}
</script>
<title>What Should I Wear Today?</title>
</head>
<body>
<h1>What Should I Wear Today?</h1>
</body>
</html>
谁能帮助我了解如何使用自定义搜索 API 根据天气返回图像?
即如果是
我对编码很陌生,所以一个好的解释会很有帮助!
【问题讨论】:
标签: javascript html css api google-custom-search