javascript - React 应用程序在 Safari 浏览器中不起作用?语法错误
问题描述
document.querySelector("[rel='icon'").setAttribute('href', {Favicon});
(function($) {
$(document).ready(function() {
$('body').on('click', '.news-text img', function(e) {
let src = $(this).attr('src');
const modal = $('#lightBoxModal');
modal.css('display', 'block');
modal.find('img').remove();
modal.find('.modal-content').append('<img src="' + src + '" alt="">');
});
$('#lightBoxModal, #lightBoxModal .close-icon').on('click', function() {
const modal = $('#lightBoxModal');
modal.find('img').remove();
modal.css('display', 'none');
});
});
})(jQuery);
SyntaxError(DOM 异常 12):字符串与预期的模式不匹配。
React 应用程序网站在 safari 中不起作用!
我该如何解决这个问题?
解决方案
似乎您在陈述的末尾缺少一个括号:
document.querySelector("[rel='icon'") // Original
document.querySelector("[rel='icon']") // <-- Fixed
推荐阅读
- java - Swagger:将 Java LocalDateTime 转换为 Joda LocalDateTime
- android - Android TV 7.1.1 问题与导航焦点
- .net - Azure 函数未并行运行
- ruby - 我无法使用 Ruby 和 Rspec 将输出转换为 Json
- docker - Docker Host和容器可以共享同一个子网吗
- python - 正则表达式模式
- mysql - 我应该如何在我的数据库设计中分离这些数据
- c - 在C中将奇数索引元素从一个数组复制到另一个数组
- javascript - 制作小书签以单击 Word Hippo 上的所有“更多 >”链接,无需在两次点击之间等待
- html - 使用存储过程有条件地格式化我的 HTML 报告?