我在JSON中收到了一个数组"transporteurs"和一个简单的POST值cmdTrp.
如果data.cmdTrp = value.id,我想在选项中添加="selected".
$.each(data.transporteurs, function (index, value) {
$('#sous_commandes_transporteurselect').append($('<option/>', {
value: value.id,
text : value.nom
}));
});
Run Code Online (Sandbox Code Playgroud)
我该怎么做 ?谢谢.
我正在使用Iscroll 5,我可以使用此代码滚动,我没有问题.唯一的问题是我的iphone我无法点击链接,我不知道为什么...
<script type="text/javascript">
var scroll;
function loaded() {
scroll = new IScroll('#contenu', {
tap:true,
desktopCompatibility: true,
scrollbars: true,
interactiveScrollbars: true,
freeScroll: true,
scrollX: true,
scrollY: true,
momentum: false,
onBeforeScrollStart: null,
mouseWheel: true
});
}
//disables browser mouse scrolling
if (window.addEventListener) {
window.addEventListener('DOMMouseScroll', wheel, false);
}
function wheel(event) {
event.preventDefault();
event.returnValue = false;
}
window.onmousewheel = document.onmousewheel = wheel;
</script>
Run Code Online (Sandbox Code Playgroud)
如果我使用此代码我可以点击但我无法滚动...
<script type="text/javascript">
var myScroll;
var showkey =true;
function loaded () {
myScroll = new IScroll('#contenu', {
tap:true,
desktopCompatibility: true, …Run Code Online (Sandbox Code Playgroud) 我有一些值,例如4,3或5.
我想只允许数字(从0到9)和逗号.
我找到了这个功能,pregmatch但它没有正常工作.
<?php
$regex="/[0-9,]/";
if(!preg_match($regex, $item['qty'])){
// my work
}
?>
Run Code Online (Sandbox Code Playgroud)
怎么了 ?谢谢
我在POST中有两个不同的值,
我想在PHP中分离25和99.
它总是被|分开.
$_POST['MYPOST'] = 25|99;
Run Code Online (Sandbox Code Playgroud)
谢谢.