Chromeでjavascriptを起動する方法について教えてください。
現在IEで運用しているWeb画面について、Chromeでの動作確認を行っているのですが、
javascriptを使用する部分で動作しない問題が発生しております。
Chromeの設定は【javascript】を「許可」としてありますが動作せず、
下記の簡単なサンプル画面を作成し動作確認しましたが、動作しない状況です。
Chromeの検証画面でエラーを見たところ以下のエラーが発生しており、
対応方法が見つからない状況です。
【HTML画面】
<html> <script type="text/javascript" src="sample.js"></script> <body> <center></body> </html><input type="button" value="Hello?" onclick="OnButtonClick();"/><br />
【javascript(sample.js)】
function OnButtonClick() {
alert('hello, world !!!');
}
【エラー内容】
Refused to execute inline event handler because it violates the following Content Security Policy directive:
"default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.
Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
このような現象の場合の原因や対応方法について、何か情報がありましたら
教えていただけるようお願い致します。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/19 08:12