vAxis.direction我想我可以通过将其设置为来反转图表的垂直轴的顺序-1。但我刚刚学习并且对编写它的方式感到困惑。
这是当前的图表:

我想反转垂直轴的顺序,0 在顶部,80 在原点。
这是现有的代码:
google.load('visualization', '1', {packages: ['corechart', 'line']});
google.setOnLoadCallback(drawBackgroundColor);
function drawBackgroundColor() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Dogs');
data.addRows([
[0, 0], [1, 10], [2, 23], [3, 17], [4, 18], [5, 9],
[6, 11], [7, 27], [8, 33], [9, 40], [10, 32], [11, 35],
[12, 30], [13, 40], [14, 42], [15, 47], [16, 44], [17, 48],
[18, 52], [19, 54], [20, 42], [21, 55], [22, 56], [23, 57],
[24, 60], …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用联系表单7的内置验证方法来验证电话号码.
联系表格7加价:
<p>[number* your-telephone min:1000000000 max:9999999999 placeholder "Telephone number"] </p>
<p>[submit "submit"]</p>
Run Code Online (Sandbox Code Playgroud)
所以,我在这里尝试做的是使用输入类型的数字的最小和最大属性来限制电话号码.但问题是如果我输入一个电话号码:0402356584然后它小于最小值但仍然是电话号码.
那么,如何设置最小值和最大值以支持所有可能的10位数电话号码?
任何其他与我的方法不同的解决方案也是最受欢迎的.因为我觉得使用min和max属性无法进行验证.
我还试图通过使用来自源代码的代码通过functions.php文件编辑插件文件,但这不起作用.
因此,如果任何人有完整的解决方案来验证联系表格7上的电话号码,那么请发布您的答案.
+----+---------------+-------+---------------+
| id | name | phone | ip_addr |
+----+---------------+-------+---------------+
| 1 | customname001 | 1234 | 192.168.100.1 |
| 2 | customname002 | 2156 | 192.168.100.2 |
| 3 | customname003 | 9685 | 192.168.100.3 |
| 4 | customname004 | 1546 | 192.168.100.1 |
| 5 | customname005 | 1234 | 192.168.100.1 |
+----+---------------+-------+---------------+
Run Code Online (Sandbox Code Playgroud)
在我的 codeigniter 项目中,我试图构建一个模型,它将帮助我将新行插入到与上面类似的表中。我在这里要应用的条件是检查姓名、电话和 ip_addr 的组合是否唯一。
我知道对于单个列,如果我们将值设置为唯一,那么这些值就不能重复,但我的示例是不同的情况,我希望所有列(除了 id 之外)的组合是唯一的。
任何人都可以帮助我构建模型,该模型将帮助我添加新的姓名、电话和 ip_addr 对,并检查该对是否已存在并相应地给出反馈。
我正在使用下面的代码片段从数组中删除所有出现的值(在本例中为97)。我不明白为什么输出数组中有一个值97。当我删除32时,它将删除数组中的所有32。与6相同。这里的97有什么问题?对我来说有点奇怪。(我本以为可能是97键入不正确或什么)。
var inputArr = [3, 97, 32, 6, 97, 2, 9,32, 1, 32, 97, 97, 6, -1, 5];
function removeItem(array, item) {
for(i = 0; i<array.length; i++){
if(array[i] == item) {
array.splice(array.indexOf(item), 1);
}
}
}
removeItem(inputArr, 97); removeItem(inputArr, 32); removeItem(inputArr, 6);
document.getElementById("output").innerHTML = inputArr;Run Code Online (Sandbox Code Playgroud)
<p id="output"></p>Run Code Online (Sandbox Code Playgroud)
I have a simple question to ask. Since I can't find any online article, posting my question here to get your views.
Which of the below syntax is correct? b inside li or li inside b. Although both does the job of making the font weight bold, I would love to know if one syntax is correct and the other one is not.
<ul>
<li><b>1</b></li>
<li><b>2</b></li>
<li><b>3</b></li>
</ul>
<ul>
<b><li>1</li></b>
<b><li>2</li></b>
<b><li>3</li></b>
</ul>Run Code Online (Sandbox Code Playgroud)
WordPress附带的jQuery处于兼容模式.为避免与其他库发生冲突,我们无法使用$快捷方式jQuery.要使用$我们使用的标志:
jQuery(document).ready(function($) {
$('#myid').css({'background': 'black', 'color': 'white'});
});
Run Code Online (Sandbox Code Playgroud)
这有效.但我的问题是如何在窗口加载时做同样的事情.自上次几个项目以来,我一直面临这个问题.所以,更好地思考这个概念.
jQuery(window).load(function($) {
$('#myid').css({'background': 'black', 'color': 'white'});
});
Run Code Online (Sandbox Code Playgroud)
有了这个,我得到一个错误,说:$ is not a function.所以,我无法$在window.load代码块内部使用.任何人都可以帮助我如何使用$里面的快捷方式window.load?
我有下面显示的代码,用于end_time从this.props.auction对象中解构属性
const {auction: {auction: {end_time}}} = this.props;
Run Code Online (Sandbox Code Playgroud)
但是这里的问题是,如果拍卖是一个空对象,则上述常量将是未定义的。为了解决这个问题,我已将代码更改为
if(Object.keys(this.props.auction).length) {
var {auction: {auction: {end_time}}} = this.props;
} else {
var {end_time} = "";
}
Run Code Online (Sandbox Code Playgroud)
上述解决方案有效但很丑陋,我相信肯定有更好的方法来做到这一点。
按照这篇文章的答案和
到目前为止,我的尝试是:
const {auction: {auction: {end_time = null}}} = this.props || {};
Run Code Online (Sandbox Code Playgroud)
我认为上面end_time的默认设置为,null但我猜因为auction没有定义它会抛出一个错误。
请提出一个更好的方法来声明end_time一个空的常量auction
HTML:
<div class="home">
<div class="a">
A content
</div>
<div class="b">
B content
</div>
<div class="c">
C content
</div>
<div class="d">
D content
</div>
<div class="e">
E content
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
要为家庭课程下的a,c和e儿童应用通用样式,我们可以使用多个css选择器,如下所示。
CSS:
.home .a,.home .c,.home .e{
background-color:#ccc;
}
Run Code Online (Sandbox Code Playgroud)
问题: 以上CSS的简称是什么?
现在,像ac和e一样是家中的普通孩子。而不是.home一遍又一遍地重复,我该如何编写一个较短的语法来选择归属类下的类a,b和c。
也许像:
.home(.a,.c,.e){
color:#ccc;
}
Run Code Online (Sandbox Code Playgroud)
我知道这是错误的,但只是对我在这里的问题,正在寻找的问题给出了清晰的想法。
我正在尝试为图标添加渐变色。虽然这适用于文本标签,但对我来说不适用于图标。任何建议将不胜感激。
.way_icon h3{
font-size: 40px;
background:-moz-linear-gradient(top, #e72c83 0%, #a742c6 100%);
background: -webkit-linear-gradient(top, #e72c83 0%,#a742c6 100%);
background: linear-gradient(to bottom, #e72c83 0%,#a742c6 100%);
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
-webkit-text-fill-color:transparent;Run Code Online (Sandbox Code Playgroud)
<div class="way_icon">
<h3>jfkfjfjr<i class="ion-ios-gear"></i></h3>
<a href="#"><i class="ion-ios-gear"></i></a>
</div>
<link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet"/>Run Code Online (Sandbox Code Playgroud)
我正在尝试减去两个小数位数更多的数字。但它正在四舍五入。如何使用 BigNumber 来确保数字不四舍五入并且计算精确。
const myObj = {
total: 5000000,
filled: 4999999.9999999996870756
};
const total = new BigNumber(myObj.total);
const filled = new BigNumber(myObj.filled);
const remaining = total.minus(filled);
console.log(total, filled, remaining);
if(remaining === 0.0000000003129244) console.log("remaining calculation is correct")
else console.log("incorrect calculation")Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/bignumber.js/8.0.2/bignumber.min.js" integrity="sha512-7UzDjRNKHpQnkh1Wf1l6i/OPINS9P2DDzTwQNX79JxfbInCXGpgI1RPb3ZD+uTP3O5X7Ke4e0+cxt2TxV7n0qQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>Run Code Online (Sandbox Code Playgroud)
概述:
我有一个代码块,我正在检查条件并重定向到page(manage_contents.php)如果condition(mysqli_num_rows($pages_set)>0)满足,因此if条件之后的所有内容都不应该执行,因为标头已被重定向.
if(mysqli_num_rows($pages_set)>0) {
$_SESSION["message"] = "can't delete a subject with pages";
redirect_to("manage_contents.php?subject={$current_subject["id"]}");
}
$id = $current_subject["id"];
//Standard delete query
$query = "DELETE FROM subjects WHERE id = {$id} LIMIT 1";
$result = mysqli_query($connection,$query);
if($result && mysqli_affected_rows($connection)==1) {
$_SESSION["message"] = "Subjects deleted";
redirect_to("manage_contents.php");
}else{
$_SESSION["message"]="Subject deletion failed";
redirect_to("manage_contents.php?subject={$id}");
}
Run Code Online (Sandbox Code Playgroud)
但是如果我执行上面的代码,则代码不会重定向(即使if条件满足)并执行if循环旁边的任何内容.
redirect_to函数:
function redirect_to($new_location) {
header("Location:".$new_location);
}
Run Code Online (Sandbox Code Playgroud)
为我工作的解决方案:
if(mysqli_num_rows($pages_set)>0) {
$_SESSION["message"] = "can't delete a subject with pages";
redirect_to("manage_contents.php?subject={$current_subject["id"]}");
} else {
$id = $current_subject["id"];
//Standard delete …Run Code Online (Sandbox Code Playgroud) 我在自定义帖子类型下有大约 2000 个帖子storelocations。从 WordPress 管理员中删除它们需要花费大量时间。
如何使用 mySQL 命令从数据库中删除此自定义帖子类型的所有帖子。这是我的方法:
DELETE FROM 'wp_posts' WHERE 'post_type' = 'storelocations'
但我想这篇文章可能还有一些数据wp_postmeta和其他一些表格。我想我也应该从那里删除数据。
那么,我可以知道哪些表有帖子的数据吗?我应该运行什么命令来清除它们。
我的另一个疑问是:与从 mySQL 删除帖子相比,为什么从 WordPress 管理员删除帖子需要花费这么多时间。WordPress 做的事情不就是运行几个 SQL 命令吗?还是有很多事情发生?
javascript ×3
php ×3
css ×2
html ×2
mysql ×2
wordpress ×2
arrays ×1
bignumber.js ×1
codeigniter ×1
ecmascript-6 ×1
forms ×1
jquery ×1
redirect ×1