我想验证文件名
文件或文件夹的名称不应包含\ /?%*:| "<>.
你能建议我在preg_match()中使用正则表达式吗?
谢谢.
我有一个来自可视网站优化器的javascript代码,它将放在HTML标题上:
var _vwo_code=(function(){
var account_id=7237,
settings_tolerance=2000,
library_tolerance=1500,
use_existing_jquery=true,
// DO NOT EDIT BELOW THIS LINE
f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
Run Code Online (Sandbox Code Playgroud)
但我想只在这种情况下运行此代码:
$(document).ready(function(){
if($('#selectedLang').val() == 'en_US')
{
//run the visual website optimizer code
}
});
Run Code Online (Sandbox Code Playgroud)
我试过这个,但返回错误"_vwo_code未定义"
$(document).ready(function(){
if($('#selectedLang').val() == 'en_US')
{
var _vwo_code=(function(){
var account_id=7237,
settings_tolerance=2000,
library_tolerance=1500,
use_existing_jquery=true,
// DO NOT EDIT BELOW THIS LINE
f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init();
}
});
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题?提前致谢!
我想计算具有类名"items"并具有属性"style = display:none"的div.
<div id="skills">
<div class="items" style="display:none">1</div>
<div class="items">2</div>
<div class="items">3</div>
<div class="items" style="display:none">4</div>
<div class="items" style="display:none">5</div></div>
Run Code Online (Sandbox Code Playgroud)
输出应该是'3'.
================================================== =========
除了问题:
<div id="skills1">
<div class="items" style="display:none">1</div>
<div class="items">2</div>
<div class="items">3</div>
<div class="items" style="display:none">4</div>
<div class="items" style="display:none">5</div></div>
<div id="skills2">
<div class="items" style="display:none">1</div>
<div class="items" style="display:none">2</div>
<div class="items" style="display:none">3</div>
<div class="items" style="display:none">4</div>
<div class="items" style="display:none">5</div></div>
Run Code Online (Sandbox Code Playgroud)
输出应该是'3'和'5'.
这是我的代码(从第35行开始):
location /
{
index index.php;
root /home/body;
if ($request_filename !~ (js|css|images|robots\.txt|index\.php.*) ) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
[emerg]: unknown directive "location" in /opt/nginx/conf/nginx.conf:35
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮忙解决这个问题吗?提前致谢.
如何在codeigniter中允许uri中的特殊字符(如:ä,é,î,ø,ù)
如何在java中以随机顺序打印数组?
例:
int [] myArray = {5,4,3,2,1};
打印时,结果可能是:
3 2 1 4 5
要么
4 3 2 5 1
jquery ×2
arrays ×1
character ×1
codeigniter ×1
count ×1
html ×1
java ×1
nginx ×1
optimization ×1
preg-match ×1
regex ×1
uri ×1
validation ×1
web ×1