嗨,我的网站工作得很好(bureaudonald.com)。添加后,只有一个JS不再工作
<meta http-equiv="Content-Security-Policy" content="default-src https:">
function GetValue()
{
var myarray= new Array(
"Why are we doing this?",
"Why are we making this?",
"Why would we add this?",
"etc"
);
var random = myarray[Math.floor(Math.random() * myarray.length)];
document.getElementById("message").innerHTML=random;
}
<!-- WHY -->
<div class="main why_loader" id="whysection">
<section data-navlink="navwhy">
<div class="why">
<div class="why_content">
<div class="why_field">
<span class="why_title" id="message">Ask Why!<br/>And Ask it Again<br/>And again</span>
</div>
<div class="why_button">
<button class="why_btn" onclick="GetValue();">Ask Why Again!</button>
</div>
</div>
<h2> </h2>
</div>
</section>
</div>