小编Ans*_*nsh的帖子

使用htaccess Https到http重定向

我正在尝试将https://www.example.com重定向到http://www.example.com.我在.htaccess文件中尝试了以下代码

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)

此代码成功将https://example.com重定向到http://www.example.com.但是,当我输入https://www.example.com时,它会在浏览器中显示"网页不可用"错误.

我也尝试了以下2个代码但没有成功

尝试1

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*):NOSSL$ http://www.example.com/$1 [R=301,L]
Run Code Online (Sandbox Code Playgroud)

尝试2

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
Run Code Online (Sandbox Code Playgroud)

以上两种尝试均失败.有什么建议?

apache .htaccess https http

66
推荐指数
4
解决办法
23万
查看次数

如何在单击时切换选中/未选中状态时更改复选框标签的颜色

当我选中或取消选中时,我正在尝试更改复选框标签的字体颜色和背景颜色.我在这个网站上找到了一个javascript解决方案但是无法让代码工作.这是我到目前为止所尝试的内容.现在它将"突出显示"类附加到父div,我只希望标签更改.谢谢你的时间.

HTML:

<div class="checkboxes">
    <input type="checkbox" name="1" id="option one" value="orange"><label for="1" class="highlight">Orange</label>
    <input type="checkbox" name="2" id="option two" value="apple"><label for="1" class="highlight">Apple</label>
</div>
Run Code Online (Sandbox Code Playgroud)

JavaScript:

$( '.checkboxes' ).on( 'click', 'input:checkbox', function () {
    $( this ).parent().toggleClass( 'highlight', this.checked );
}); // end checkbox style?
Run Code Online (Sandbox Code Playgroud)

CSS:

.checkboxes label {
    font-family:Open Sans Italic;
    font-size: 12px;
    color: #666;
    border-radius: 20px 20px 20px 20px;
    background: #f0f0f0;
    padding: 3px 10px;
    text-align: left;
}
.highlight {
    font-family:Open Sans Italic;
    font-size: 12px;
    color: white;
    border-radius: 20px 20px …
Run Code Online (Sandbox Code Playgroud)

css checkbox jquery

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

D3.js 图表 - 在两行中显示图例

我想在 D3.js 图表顶部的两行中显示 10 个图例元素。我尝试过以下方法

legend.append("rect").attr("width", 20).attr("height", 15).style("fill", function(d) {
return color(d.packageName);
});

legend.append("text").attr("dx", +25).attr("dy", "0.8em").style("text-anchor","front").style("fill", "#666").text(function(d) {
return d.packageName;
});

var margin = {
 top: 30,
 right: 20,
 bottom: 30,
 left: 40
};

d3.selectAll(".legend").each(function(d, i) {
  return d3.selectAll(".legend").attr("transform", i < 6 ? function(d, i) {
  return "translate(" + ((i * 100) + (diameter / 10) - 25) + "," + (+margin.top * 2) +")";
  } : function(d, i) {
  return "translate(" + ((i * 100) + (diameter / 10) …
Run Code Online (Sandbox Code Playgroud)

svg d3.js

3
推荐指数
1
解决办法
3269
查看次数

标签 统计

.htaccess ×1

apache ×1

checkbox ×1

css ×1

d3.js ×1

http ×1

https ×1

jquery ×1

svg ×1