<div class="comments"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
const darkModeMeidaQuery = window.matchMedia('(prefers-color-scheme: dark)');
function updateForDarkModeChange() {
if (darkModeMeidaQuery.matches) {
var colorScheme = 'dark'
} else {
var colorScheme = 'light'
}
$('.comments').append('<script src="https://utteranc.es/client.js" repo="user/repo-name" issue-term="pathname" theme="github-'+colorScheme+'" crossorigin="anonymous" async><\/script>');
}
darkModeMeidaQuery.addListener(updateForDarkModeChange);
updateForDarkModeChange();
</script>
我正在尝试加载话语以将浏览器主题与上述脚本匹配。但是,该对象是正常创建的,但它抛出:Uncaught Error: "issue-term" or "issue-number" must be specified.
我尝试转义字符,但它不起作用。有没有我写错的部分?
MYYA
相关分类