<header>
<!-- Text -->
<h2>Projekt 0001/28.08.19</h2>
<p>
Hier soll das Wetter von einigen Städten angezeigt werden. Versuch mal deine Stadt einzugeben! :)
</p>
<section class="wettereingabe">
<label for="patty">In Welcher Stadt soll es nicht so heiß wie in HH sein?</label>
<input type="text" name="wetter" class="wetterClass" id="wetter">
<Button onclick="test()">Click me!</Button>
</section>
<!-- /Text https://api.datamuse.com/words?ml= https://api.datamuse.com/words? -->"
</body>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.js" > </script>
<script>
function test(){
var word = document.getElementById('wetter').value;
var temp1 = $.get('https://api.datamuse.com/words?ml='+word, {}, response)
function response(statusCode, data){
console.log(statusCode);
console.log(data);
}
// alert('Wetter in ' + word + ' ' + temp1);
$(word).click(() => {
$('nein').toggle()
// var url = 'https://api.datamuse.com/words?';
// //var url = 'https://api.openweathermap.org/data/2.5/weather?q=London,uk&APPID=1e2a3abbf4d964634c903792a8bd3683';
// $.ajax({
// url: url,
// type: 'get',
// data: {},
// success: function(data){
// alert('success!'+url);
// console.log(data);
// },
// error: function(){
// alert('error!');
// }
});
}
</script>
</html>
<!-- $('#login').click(() => {
$('#loginMenu').toggle()
}); -->
Выложи на codepen
Обсуждают сегодня