1
因此,我正在嘗試創建一個網站,讓我可以每天更改圖片。我需要幫助將圖像源設置爲變量imageurl
。此外,使變量imageurl
是全球性的。具有多變圖像源的網站
讓我澄清,我希望它能夠將變量imageurl
設置爲由提示設置的鏈接,然後將圖像設置爲imageurl
。
<!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>
你真的寫了還沒有任何Java代碼? –
Java還是Javascript? –
下的身體標記。它從「function myFunction()」開始 –