Also, ich versuche, eine Website zu machen, wo ich ein Bild haben kann, das sich täglich ändert. Ich brauche Hilfe, die Bildquelle auf die Variable imageurl
einzustellen. Außerdem ist es so, dass die Variable imageurl
global ist.Website mit veränderbarer Bildquelle
Lassen Sie mich klären, ich will es so, dass es die Variable imageurl
auf einen Link setzt, der durch eine Eingabeaufforderung festgelegt wird, dann legt das Bild auf imageurl
fest.
<!DOCTYPE html>
<html>
<head>
<div align="center">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>picture of the day</title>
<h1>Jere's picture of the day</h1>
<link href="style.css" rel="stylesheet" type="text/css">
</div>
</head>
<body>
<style>
div {
background-color: #8000ff;
color: #ffffff;
padding: 20px;
}
</style>
<script src="code.js" type="text/javascript" charset="utf-8"></script>
<script>
function myFunction() {
isitjere = prompt("Password?");
if (isitjere === "thedog")
alert("password:" + isitjere + " " + "has been accepted");
editimage = prompt("do you want to change the image?(type yes or no)");
if (editimage === "yes")
imageurl = prompt("paste the image url(if you dont have a url for it you can upload it and paste the upload link)");
}
</script>
<button onclick="myFunction()">edit</button>
<img src=imageurl>
</div>
</body>
</html>
Sie tatsächlich haben Sie eine Java-Code noch nicht geschrieben? –
Java oder Javascript? –
unter dem Body-Tag. es beginnt bei "function myFunction()" –