私はFree Code Camp's "Random Quote Machine"を使って作業していますが、私は非常に(非常に)重視したモデルを作りましたが、引用符をつけて自分のコードの方法でつぶす方法はわかりません。私は現在のJavascriptコードを変更する必要がありますか?それとも私の現在のコードで私が気づいていないつぶやきを送信する方法はありますか?私は解決策があるanother question like thisがあることを知っていますが、私はそれを理解しませんでした。本当にありがとう。ランダム引用機械、つぶやき引用
var quotes= [
'I love you the more in that I believe you had liked me for my own sake
and for nothing else. John Keats',
'But man is not made for defeat. A man can be destroyed but
not defeated. Ernest Hemingway',
'When you reach the end of your rope, tie a knot in it and
hang on. Franklin D. Roosevelt',
'Always do what is right. It will gratify half of mankind
and astound the other. ― Mark Twain',
'Whenever you find yourself on the side of the majority, it
is time to pause and reflect. Mark Twain',
'It is curious that physical courage should be so common in
the world, and moral courage so rare.- Mark Twain in Eruption',
'A man should not be without morals; it is better to have
bad morals than none at all.- Mark Twain\'s Notebook',
'The most permanent lessons in morals are those which come,
not of book teaching, but of experience.- A Tramp Abroad',
'But the fact that he can do wrong proves his moral
inferiority to any creatures that cannot.― Mark Twain',
'\“Wrong does not cease to be wrong because the majority
share in it.\” ― Leo Tolstoy',
'\“Right is right even if no one is doing it; wrong is wrong
even if everyone is doing it.\” ― Augustine of Hippo'
]
function nextQuote() {
var randomNumber = Math.floor(Math.random()*quotes.length);
document.getElementById("displayQuote").innerHTML = quotes[randomNumber];
}
<h1>Random Quote Machine</h1>
<!--Javascript will go in div-->
<div>
<h2 id="displayQuote"></h2>
</div>
<button onclick="nextQuote()">New Quote</button>
<button id="tweetQuote"><a>Tweet</a></button>
私はそれが非常に高速である、それは改行を持っていないので、あなたは正しいです、それを作りました。そこから見積もりをつぶす方法を知っていますか?私はこの投稿(https://stackoverflow.com/questions/45172377/twitter-share-button-with-random-quote?rq=1)に行ってきましたが、addEventListenerを追加することによって、彼らが何をしているのか分かりませんでした。 (私はW3の学校に行った)私はこれが初心者の質問であることを知っている、あなたの忍耐のためにありがとう –
@JohnSmith注意:私のコードにバグがありました。今、そのupdatetと大丈夫... – Axel
残念ながら、私はまだ15人の担当者を持っていない、 "それは記録されますが、公に追加されていません。私が15歳になると、私は戻って、投票ボタンを再度押してください。あなたの善行は気づかれません。ご協力ありがとうございました。 –