« first day (1577 days earlier)      last day (1344 days later) » 

 
2 hours later…
8:49 AM
You could not miss-spell Merkel the second time :-P
 
Ofc sry
3 messages moved from C#
 
 
13 hours later…
9:23 PM
@HiAPL
function newCard(currentCardNumber = 0) {
  const randomNumber = Math.floor(Math.random() * 4);
  console.log(currentCardNumber)
  if (randomNumber == currentCardNumber) {
    newCard(currentCardNumber);
  } else {
    document.getElementById("currentCardNumber").value = randomNumber;
    document.getElementById("cardImage").src = Object.values(
      cards[randomNumber]
    )[1];
    document.getElementById("cardName").innerHTML = Object.values(
      cards[randomNumber]
    )[0];
  }
}
 
@K-Biz Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
@K-Biz Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
3 messages moved from JavaScript
 
<img src="" alt="random card pic" id="cardImage">
</div>
<div id="cardName">
  <!-- The card name will display here -->
</div>
<input type="hidden" name="currentCardNumber" id="currentCardNumber" />
<button onclick="newCard(currentCardNumber)">New Card</button>
<script src="cardpull.js"></script>
As you can see, it works the first time because I have a default value but after that, I can't figure out how to send "currentCardNumber" back to newCard(). I've tried newCard(currentCardNumber) but it doesn't seem to be holding the value I passed through from JS the first time.
 
@K-Biz no
@K-Biz into the jsfiddle, not the friendly bin
put it there
and then save and send a link in js chat
 
Ok, I have no idea what I'm doing. I'll just post it into a question until I can figure this out. It's not totally user friendly for newbies.
Thanks though JBis. I'll read up on it and try again later.
 

« first day (1577 days earlier)      last day (1344 days later) »