我正在尝试创建Chrome扩展程序,但我的JS都没有.控制台显示此错误:
拒绝加载脚本' https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js ',因为它违反了以下内容安全策略指令:"script-src'self'blob :filesystem:chrome-extension-resource:".
为什么阻止我的jQuery运行?
html javascript jquery google-chrome google-chrome-extension
我只需要使用以下CSS来关闭模态:http : //jsfiddle.net/raving/1mhsynmw/
但是,我无法使其正常工作。我的模态如下。
function alert(msg) {
document.getElementById("alert").innerHTML = '<div class="modal-overlay"><div class="modal"><div class="modal-container"><h3>' + msg + '</h3><p>' + msg + '</p></div><p class="modal-footer"><a href="javascript:" id="ok">OK</a></p></div>';
}
alert("This is some text to show you this modal. This is some text to show you this modal. This is some text to show you this modal. This is some text to show you this modal.");Run Code Online (Sandbox Code Playgroud)
body {
font-family:arial;
font-size:11px;
}
.modal {
position: fixed;
top: 20px;
margin-left: auto;
margin-right: auto;
left: 0;
right: …Run Code Online (Sandbox Code Playgroud)有没有办法强制关闭 chrome 扩展并在关闭后自动重新打开它?
我收到错误,我不知道如何解决它..
错误是:
解析错误:第7行的C:\ xampp\htdocs\records\delete-confirm.php中的语法错误,意外的'(',期望变量(T_VARIABLE)或'$'
第7行是:
echo "<script>$(document).ready(function(){$('.modal-" . $row->id . "').hide();$('#delete-" . $row->id . "').click(function(){$('.modal-" . $row->id . "').show();});$('#cancel-" . $row->id . "').click(function(){$('.modal-" . $row->id . "').hide();});});</script>";
Run Code Online (Sandbox Code Playgroud)
我检查了整条线,但那里似乎没有错误?这里出了什么问题?