我使用自动数字。input当您将鼠标悬停在input元素上时,添加到 的数据将被清除。为什么值被清除?如何解决?演示
$('#thermForwardStream').focusout(function () {
var thermForwardStream = $('#thermForwardStream').val();
var thermBackStream = $('#thermBackStream').val();
if (thermBackStream == "70" ) {
$.ajax({
type: 'POST',
dataType: 'json',
data: { 'thermForwardStream': thermForwardStream, 'thermBackStream': thermBackStream },
url: '@Url.Action("GetDataAnnexY", "ThermLosses")',
success: function (data) {
$('#tempHeatExchangerOne').val(data.thermForwardStream);
$('#tempHeatExchangerTwo').val(data.thermBackStream);
}
});
}
});
const autoNumericOptions = {
allowDecimalPadding: "floats",
decimalCharacter: ",",
digitGroupSeparator: "",
emptyInputBehavior: "zero"
};
new AutoNumeric('#thermForwardStream', autoNumericOptions);
new AutoNumeric('#thermBackStream', autoNumericOptions);
new AutoNumeric('#tempHeatExchangerOne', autoNumericOptions);
new AutoNumeric('#tempHeatExchangerTwo', autoNumericOptions);Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.1.0"></script>
<input class="form-control …Run Code Online (Sandbox Code Playgroud)所以,我想知道/要求; 是否可以在APL中执行If语句?如果是这样的话?
这是我的代码
'Please enter a number to count to: '
number ??
?number
Run Code Online (Sandbox Code Playgroud)
我如何获得一个if语句,如果用户输入的数字超过100,它将打印出"太高"并结束; 或者如果它是100或者那么它会继续吗?
谢谢!
我正在尝试将滚动条添加到引导模式主体。但它添加到整个内容。如何将它添加到仅 body.was 使用具有长内容的模态,当达到给定的最大高度时,模态会自动滚动。
这是我的代码
<head>
<!-- Bootstrap CSS-->
<link href="/<s:text name="app.name"/>/css/bootstrap.min.css" rel="stylesheet" type="text/css">
.modal-body {
max-height: calc(100vh - 212px);
overflow-y: auto;
}
</head>
<body>
<div>
<s:if test="user.level == 0 && name != ''">
<button id="roleBtn" class="btn btn-info" type="button" onclick=""
data-toggle="modal" data-target="#roleModal">
<s:text name="roles"/>
</button>
</s:if>
</div>
<div class="modal" id="roleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" style="overflow-y: scroll; max-height:80%; margin-top: 60px; margin-bottom:30px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel"><s:text name="headingRoles"/></h4>
</div>
<s:form theme="simple" method="post" …Run Code Online (Sandbox Code Playgroud) 在TYPO3模板中,我使用以下代码插入图像:
page.10.marks{
GRAFIK-LINKS = IMAGE
GRAFIK-LINKS.file = fileadmin/images/header-a.png
}
Run Code Online (Sandbox Code Playgroud)
现在,只要我不使用说话URL就可以运行,但是当启用RealURL或CoolURI等扩展时,图像将不再显示.问题是生成的HTML使用相对路径引用这些图像:
<img xmlns="http://www.w3.org/1999/xhtml" width="520" height="180" border="0" alt="" src="fileadmin/images/header-a.png" />
Run Code Online (Sandbox Code Playgroud)
然后翻译成http://example.com/speaking-URL/in-deep-path/fileadmin/images/header-a.png并没有在那里找到:(
我怎样才能让TYPO在这里使用绝对引用?
我想要一个正则表达式来匹配双引号中的所有单词.
考虑一下这条线:
the quick "brown fox" jumps
Run Code Online (Sandbox Code Playgroud)
这些话brown和fox应匹配,而不是the,quick或jumps.
以下是我的第一次尝试:
".*\zs\w\+\ze.*"
Run Code Online (Sandbox Code Playgroud)
不幸的是,贪婪.*导致正则表达式消耗超过我想要的,并且只是xin fox匹配.通过使用\{-}而不是*(vim的非贪婪等价物),我们得到修改后的正则表达式:
".\{-}\zs\w\+\ze.*"
Run Code Online (Sandbox Code Playgroud)
但是这只匹配引号(brown)中的第一个单词,而不是我想要的所有单词.
可以用正则表达式完成我想要做的事情吗?
试图在Bootstrap-Popup中显示错误消息,我找到了TheDude 的解决方案并调整了ps2.1的事件名称:
$.listen('field:error', function (fieldInstance) {
arrErrorMsg = ParsleyUI.getErrorsMessages(fieldInstance);
errorMsg = arrErrorMsg.join(';');
fieldInstance.$element
.popover('destroy')
.popover({
container: 'body',
placement: 'right',
content: errorMsg
})
.popover('show');
});
$.listen('field:success', function (fieldInstance) {
fieldInstance.$element.popover('destroy');
});
Run Code Online (Sandbox Code Playgroud)
这非常有效,但我在JS-Console中获得了一个msg:" Parsley的pubsub模块已弃用;请改用相应的jQuery事件方法 ".Google中的msg很少有点击,而且我担心我(还)不够熟悉Parsley来理解和解决这个问题 - 我会感谢一些帮助,使我的代码能够面向未来:-)
我试图在创作后隐藏一个选择控件.所以我设置了一些代码chosen:ready来隐藏容器.但似乎没有触发事件.
Repro:codepen
HTML:
<div style="width:200px;" id="MCchsn_id711552766_2">
<select id="id711552766_2" style="width:100%" name="id711552766_2">
<option disabled="disabled" selected="selected">[Select]</option>
<option>ChoiceA</option>
<option>ChoiceB</option>
</select>
</div>
Run Code Online (Sandbox Code Playgroud)
JS:
$(function() {
$("#id711552766_2").chosen();
$("#id711552766_2").on("update",function () { console.log($(this).text);});
$("#id711552766_2").on("chosen:ready",function() {$("#MCchsn_id711552766_2").hide();alert("hidden");});
});
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
我想用autoNumeric设置标签的值,但它没有像我这样设置我试过的值
$('#lblTotal').autoNumeric(data.total);
Run Code Online (Sandbox Code Playgroud)
但它没有设置值anyOne使用它???
jquery ×3
javascript ×2
ajax ×1
apl ×1
gnu-apl ×1
hide ×1
if-statement ×1
parsley.js ×1
regex ×1
typo3 ×1
typoscript ×1
vim ×1