RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-313381

Владислав Самохин's questions

Martin Hope
Владислав Самохин
Asked: 2021-10-10 21:03:52 +0000 UTC

inputmask isComplete 所有类

  • 1

您能告诉我如何使用 inputmask 插件检查具有相同类的所有字段的完整性吗?现在检查只在第一个字段上。

$(document).ready(function() {
  $(".phone").inputmask("+38 (999) 999-99-99");
});

function check_validate() {
  if ($(".phone").inputmask("isComplete")) {
    console.log("validate = ok");
  } else {
    console.log("validate = no");
  }
}
button {
  display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/inputmask/4.0.9/jquery.inputmask.bundle.min.js" integrity="sha256-O4r2M4p1dxfVFgKvwK23D1RQdTU8ABlIBir9aGP+KJY=" crossorigin="anonymous"></script>
<input type="text" class="phone">
<input type="text" class="phone">
<input type="text" class="phone">
<button onclick="check_validate();">Validate</button>

jquery
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-08-14 21:36:28 +0000 UTC

在 MySQL 中添加和显示表情符号

  • 0

当发送 POST 请求以更改 emoji 编码的text字符串时,utf8mb4_general_ci它们在数据库中显示为问号????。可能是什么问题呢?如何正确地将带有表情符号的字符串写入数据库?有关信息:如果您手动将表情符号插入一行,则表情符号echo $row['text'];在输出中显示为单个问号。我正在使用 PDO。

php
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-08-14 16:59:56 +0000 UTC

已修复 div 中的引导模式

  • 1

请告诉我模态窗口是否在模态窗口的内容在后面div的块中。position: fixed<div class="modal-backdrop show"></div>

怎么修?

$("button").click(function() {
  $(".modal").modal("show");
});
#content {
  width: 100vw;
  height: 100vh;
  position: fixed;
  z-index: 1;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div id="content">
  <button>Open modal</button>
  <div class="modal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title">Modal title</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        </div>
        <div class="modal-body">
          <p>Modal body text goes here.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-primary">Save changes</button>
          <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
</div>

html
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-06-25 22:23:42 +0000 UTC

将数字增加 0.1 jquery

  • 2

请告诉我为什么更改数量时会有小数点后10位的数字?

function plus_modifier_count_product() {
  var count = parseFloat($("#amount").val());
  var new_count = count + 0.1;
  $("#amount").val(new_count);
}

function minus_modifier_count_product() {
  var count = parseFloat($("#amount").val());
  var new_count = count - 0.1;
  $("#amount").val(new_count);
}
.modifier_count {
  display: inline-block;
  width: 20px;
  border: 2px solid blue;
  text-align: center;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="modifier_count" onclick="minus_modifier_count_product();">-</div>
<input type="number" id="amount" placeholder="Количество" value="1.5" step="0.1">
<div class="modifier_count" onclick="plus_modifier_count_product();">+</div>

html
  • 2 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-06-15 23:41:39 +0000 UTC

输出mysql记录(不输出较低的id)

  • 0

请告诉我。有一张表,里面有 5 条 id 未知的记录。

id
10
20
30
40
50

如何选择按此顺序显示表格(不显示最小的 id)

id
20
30
40
50
mysql
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-06-12 02:27:21 +0000 UTC

从 url 节点 js 获取图像

  • 1

请告诉我,这样我可以从代码所在的目录中获取图像:

const logo = path.join(__dirname, 'tux.png');

我可以使用外部源链接抓取图像吗?示例代码: https ://github.com/song940/node-escpos/blob/v3/examples/image.js

node.js
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-05-13 21:57:05 +0000 UTC

未写入成功的ajax变量

  • 1

请告诉我为什么没有写入来自成功 ajax 的变量:

function check() {
  var mail_check;
  $.ajax({
    type: "POST",
    url: "/mail_check.php",
    data: {
    },
    success: function(html) {
      mail_check = 1;
    }
  });
  if (mail_check === 1) {
  /*code*/
  }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="button" onclick="check();" value="go">

ajax
  • 2 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-04-14 15:03:21 +0000 UTC

点击jquery的功能

  • 0

您能告诉我为什么当您再次单击 1 个选项卡时,样式不会改变吗?当您单击其他选项卡时,一切都很好。

$(".no_active_tab").click(function() {
  $(".active_tab").removeClass("active_tab").addClass("no_active_tab");
  $(this).removeClass("no_active_tab").addClass("active_tab");

});
.tabs_name .no_active_tab {
  display: table-cell;
  padding: 10px;
  padding-left: 20px;
  padding-right: 20px;
  border-right: 1px solid #f3f3f3;
  cursor: pointer;
  background: #f6f8fa;
}

.tabs_name .active_tab {
  background: #fff;
  color: inherit;
  display: table-cell;
  padding: 10px;
  padding-left: 20px;
  padding-right: 20px;
  border-right: 1px solid #f3f3f3;
  cursor: pointer;
  background: #fff;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="card" class="tabs">
  <div class="tabs_name">
    <div data-open="are_settings" class="active_tab">
      1
    </div>
    <div data-open="shop_settings" class="no_active_tab">
      2
    </div>
    <div data-open="account_settings" class="no_active_tab">
      3
    </div>
    <div data-open="tarif_settings" class="no_active_tab">
      4
    </div>
  </div>
</div>

html
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-04-08 21:41:04 +0000 UTC

根据重复次数输出字符串

  • 2

如何首先显示那些最常重复的行?该行必须是id_product( DISTINCT)上的一个

id|id_product|
1 |    1     |
2 |    2     |
3 |    3     |
4 |    3     |
5 |    4     |
6 |    4     |
7 |    4     |
8 |    4     |
9 |    5     |

结果应该是这样的:

id|id_product|
5 |    4     |
4 |    3     |
9 |    5     |
2 |    2     |
1 |    1     |
mysql
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-04-06 22:42:12 +0000 UTC

SUM mysql 错误地输出

  • 0

请告诉我为什么在这个查询中它显示 2500 而不是 5000。

SELECT SUM(price) FROM products WHERE id IN 
(SELECT id_product from order_products WHERE id_order=1)
products table
id | price
1  | 2500
order_products table
id | id_order |id_product 
1  | 1        | 1
2  | 1        | 1
mysql
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-04-06 18:14:23 +0000 UTC

在页面上查找元素并获取它们的值 jquery

  • 1

你能告诉我如何input在其中找到所有内容div并显示它们的值吗?

<div>
<input type="hidden" value="1">
<input type="hidden" value="2">
<input type="hidden" value="3">
</div>

html
  • 3 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-04-01 02:06:19 +0000 UTC

从节点 js 发布请求声明变量

  • 0

请告诉我如何使用post请求声明到达服务器(节点js)的变量。现在我使用此代码并获得以下内容

name=Test&ip=192.168.0.1

如何声明一个变量并为其分配一个值,如下所示:

var name = "Test"; 
var ip = "192.168.0.1";

我正在使用的代码:

var http = require("http");
http.createServer(function(request, response){
    if (request.method === 'POST') {
        let body = '';
        request.on('data', chunk => {
            body += chunk.toString(); // convert Buffer to string
        });
        request.on('end', () => {
            console.log(body);
        });
    }
    response.end()
}).listen(3000);
node.js
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-30 21:28:53 +0000 UTC

检查文件是否存在 + 加载新的 php

  • 1

请告诉我,有一个文件夹,文件夹中有 3 个文件,名称分别为0.jpg, 1.jpg, 2.jpg. 我正在上传文件并将它们重命名为序列号。如果在输入中选择了 3 个文件,则它们的序列号与文件夹中文件的名称相同。我该如何解决这个问题,如果文件夹中有文件0.jpg而没有文件,1.jpg请命名给定文件1.jpg?

$count_files = count($_FILES["files"]['name']);
for ($i = 0; $i < $count_files; $i++) {
   $exists_file = $i.".jpg";
   if (file_exists($exists_file)) {

   } else {

   }
   $name[$i] = $i.".jpg";
   move_uploaded_file($_FILES["files"]["tmp_name"][$i], $_SERVER['DOCUMENT_ROOT']."/files/".$name[$i]);
}
php
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-30 19:57:18 +0000 UTC

在 html 元素 jquery 中查找文本匹配

  • 1

请告诉我如何隐藏div内容与input. 如果内容div="Один"是内容,input="од"则不div隐藏。

试图:

$("#search_text").keyup(function(e) {
  var text = $("#search_text").val();
  if ($(".search_block div").text() != text) {
    $(this).hide;
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" id="search_text">
<div class="search_block">
  <div>Один</div>
  <div>Два</div>
  <div>Три</div>
  <div>Четыре</div>
  <div>Пять</div>
</div>

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-30 15:02:53 +0000 UTC

将 data-id 添加到 jquery 元素

  • 1

您能告诉我如何将本地照片分配给具有背景的data-id='i'元素吗?<div>

$(function() {
  var imagesPreview = function(input, placeToInsertImagePreview) {
    if (input.files) {
      var filesAmount = input.files.length;
      for (i = 0; i < filesAmount; i++) {
        var reader = new FileReader();
        reader.onload = function(event) {
          $($.parseHTML("<div class='add_photo' data-id=''>")).css("background", "url(" + event.target.result + ")").appendTo(placeToInsertImagePreview);
        }
        console.log(i);
        reader.readAsDataURL(input.files[i]);
      }
    }
  };
  $('#gallery-photo-add').on('change', function() {
    imagesPreview(this, '#photo_add_preview');
  });
});
.add_photo {
  width: 100px;
  height: 100px;
  background-size: cover!important;
  background-position: center!important;
  display: inline-block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label for="gallery-photo-add">
      <span aria-hidden="true">Загрузить</span>
      <input type="file" multiple id="gallery-photo-add" style="display:none" accept="image/*">
</label>
<div id="photo_add_preview"></div>

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-27 00:08:40 +0000 UTC

e.preventDefault() 不起作用

  • 2

告诉我为什么活动取消不起作用e.preventDefault()

$("#text").keyup(function(e) {
  if (e.which == 188) {
    e.preventDefault();
    console.log("введена запятая, а не должна");
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<textarea id="text"></textarea>

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-26 21:57:52 +0000 UTC

输出 div js 中的文本

  • 2

请告诉我如何显示仅在其中的<div>文本asd

$("#text").click(function() {
  var text = $("#text").text();
  console.log(text);
})
#text {
  width: 100px;
  height: 50px;
  border: 1px solid;
}

#text span {
  background: red;
  width: auto;
  display: inline-block;
  margin-right: 5px;
  padding: 5px;
  border-radius: 3px;
  color: #fff;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="text" contenteditable="true"><span contenteditable="false">Текст</span>
asd</div>

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-26 21:28:30 +0000 UTC

在 div contenteditable 中编辑

  • 0

请告诉我如何使元素<span></span>无法编辑。您只需要编辑其中的信息<div></div>并将光标放在<span></span>.

#text {
  width: 100px;
  height: 50px;
  border: 1px solid;
}

#text span {
  background: red;
  width: auto;
  display: inline-block;
  margin-right: 5px;
  padding: 5px;
  border-radius: 3px;
  color: #fff;
}
<div id="text" contenteditable="true">
  <span>Текст</span>
</div>

html
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-06 16:39:59 +0000 UTC

如果条件按mysql排序

  • 3

请告诉我有一张桌子:

id|user_with|user_creator|fav_user_with|fav_user_creator|
1 |   10    |     15     |      1      |        0       |
2 |   10    |     15     |      0      |        1       |
3 |   15    |     10     |      0      |        1       |
4 |   15    |     10     |      1      |        0       |
5 |   15    |     10     |      0      |        1       |

我该怎么做排序。

如果user_creator = 15然后。fav_user_creator = 1_order by fav_user_creator desc, id desc

如果user_with = 15然后。fav_user_with = 1_order by fav_user_with desc, id desc

它应该在第一个条件下工作:

id|user_with|user_creator|fav_user_with|fav_user_creator|
2 |   10    |     15     |      0      |        1       |
5 |   15    |     10     |      0      |        1       |
4 |   15    |     10     |      1      |        0       |
3 |   15    |     10     |      0      |        1       |
1 |   10    |     15     |      1      |        0       |

它应该在第二种情况下工作:

id|user_with|user_creator|fav_user_with|fav_user_creator|
4 |   15    |     10     |      1      |        0       |
5 |   15    |     10     |      0      |        1       |
3 |   15    |     10     |      0      |        1       |
2 |   10    |     15     |      1      |        0       |
1 |   10    |     15     |      0      |        1       |
mysql
  • 1 个回答
  • 10 Views
Martin Hope
Владислав Самохин
Asked: 2020-03-03 20:42:34 +0000 UTC

从具有限制mysql的数据库中获取行

  • 2

请让我知道此表是否存在。

SELECT id FROM users order by id DESC
id
10|
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
SELECT id FROM users order by id ASC
id
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10|

我怎样才能做出这个选择?C. LIMIT 5_

id
6 |
7 |
8 |
9 |
10|
mysql
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5