小编web*_*lik的帖子

Chrome 64 Uncaught DOMException:无法在'CSSStyleSheet'上执行'insertRule':无法访问StyleSheet以插入规则

啊!我的网站在Chrome中被破坏了.

在控制台中获取此消息: Uncaught DOMException: Failed to execute 'insertRule' on 'CSSStyleSheet': Cannot access StyleSheet to insertRule

它指向这行代码,它来自第三方插件:

document.styleSheets[0].insertRule(rule,0);
Run Code Online (Sandbox Code Playgroud)

样式表在头部定义:

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400,700">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="/Public/js/jquery-ui/jquery-ui.css" />
<link type="text/css" rel="stylesheet" href="/Public/js/jquery-ui/jquery-ui.theme.min.css" />
<link type="text/css" rel="stylesheet" href="/Public/css/msgPop.css" />
<link type="text/css" rel="stylesheet" href="/Public/js/select2/select2.css">
Run Code Online (Sandbox Code Playgroud)

javascript css google-chrome

7
推荐指数
1
解决办法
2843
查看次数

使用通配符ID选择div

如何使用它的ID但使用widcard选择div?

如果是DIV的ID statusMessage_1098,我想以某种方式选择它document.getElementById('statusMessage_*').

这是因为在生成页面之前,我不知道ID的后缀,并且页面中只会出现一个这样的ID.这可能吗?

谢谢你的帮助.

javascript jquery dom prototypejs

6
推荐指数
3
解决办法
4万
查看次数

如何在 JS 中对 URL 进行编码并在 PHP 中进行解码?

以下是我的JS代码:

window.location.href = 'products.php?price_range=-INFto2000,2001to5000';
Run Code Online (Sandbox Code Playgroud)

我的问题是如何在 javascript 中对 URL 进行编码并在 PHP 中对其进行解码,这样我的浏览器的导航栏就会显示

“products.php?price_range=-INFto2000%2C2001to5000”

代替

“products.php?price_range=-INFto2000,2001to5000”

我的 php 代码将能够使用-INFto2000,2001to5000in的正确值$_GET['price_range']

javascript php urlencode urldecode

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

javascript ×3

css ×1

dom ×1

google-chrome ×1

jquery ×1

php ×1

prototypejs ×1

urldecode ×1

urlencode ×1