我想强制执行
如何在javascript中限制这两个规则?
下面是我的用户名正则表达式的代码(jsp).但它没有正常工作.
function validateForm(){
var nameRegex = /^[a-zA-Z\-]+$/;
var validfirstUsername = document.frm.firstName.value.match(nameRegex);
if(validUsername == null){
alert("Your first name is not valid. Only characters A-Z, a-z and '-' are acceptable.");
document.frm.firstName.focus();
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
尝试在我的 mac 上设置 localhost 并在 /etc/apache2/httpd.conf 中进行以下更改
DocumentRoot "/Users/xxx/Documents/workspace/firstRepo/htdocs"
<Directory "/Users/xxx/Documents/workspace/firstRepo/htdocs">
Run Code Online (Sandbox Code Playgroud)
我知道这与 dir 权限有关,因此我按照在线建议并运行以下命令:
find /Users/xxx/Documents/workspace -type d -exec chmod 755 {} \;
find /Users/xxx/Documents/workspace -type f -exec chmod 644 {} \;
Run Code Online (Sandbox Code Playgroud)
这里没有运气。有人可以帮我弄这个吗?谢谢。
我想检查loggedIn用户是否喜欢指定的页面.以下是我的代码.
$fql_pageid = "SELECT url,site,id FROM object_url WHERE url
IN('http://developers.facebook.com/')";
$api_pageid = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql_pageid
));
$pageid = $api_pageid[0]["id"]; //get id of the specified page
$fql_like = 'SELECT object_id FROM like WHERE user_id=me()';
$api_like = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql_like
));
Run Code Online (Sandbox Code Playgroud)
当我这样做时var_dump($api_like),只出现了6条记录.但我检查了我的Facebook帐户,有22个喜欢.
谁知道上面的代码有什么问题?或者有没有其他方法来检查用户是否喜欢指定的页面?
apache ×1
facebook ×1
facebook-fql ×1
httpd.conf ×1
javascript ×1
localhost ×1
permissions ×1
regex ×1