Open JoeViviano opened 8 years ago
Looks good! I noticed you put double apostrophes inside the joke to try to simulate quotes, since "
is being used to start and end the string. Here's a trick you can use to get actual quotes in your joke:
alert("You can use a backslash to \"escape\" a character in a JavaScript string. This is especially useful when you want to use a character that would otherwise end the string.")
The indentation is also a tiny bit off inside the script
tag. This is what I would use instead:
<script>
function ButtonFunction() {
alert("What is Donald Trump's position on foreign policy? ''If you mess with the United States, there will be hell toupee.''");
}
</script>
The opening {
and closing }
are wrapping the alert, so that's why they're intented on the same level and the alert is indented one level inside it. Does that make sense?
Great! Thanks for the comments, Chris. I've uploaded the revised code to GitHub and the new website can be viewed at alert-space.surge.sh .
Beautiful!!💥 🎉 :shipit:
Hey @chrisvfritz, can you take a look at this? It's hosted here and meets the following project criteria:
button
that will display a silly, but tasteful joke in analert
when clicked