我通过Facebook登录我的网站后得到用户的姓名和电子邮件ID ..我想在登录表单上使用javascript在会话中添加这些变量; 我试过以下:
FB.api('/me', function(me) {
if (me.name) {
document.getElementById('auth-displayname').innerHTML = me.name; <% Session["fbName"] = me.name; %>
}
}
Run Code Online (Sandbox Code Playgroud)
它给出了像我这样的错误(在这一行:<%Session ["fbName"] = me.name;%>)在当前上下文等中不存在.我的div"auth-displayname"正在获得该值,但是我我有会话变量的问题
我怎样才能做到这一点
如何用Delphi解锁windows锁屏?我没有在Google或Stackoverflow上找到任何内容.我已经尝试使用keybd_event输入我的密码,但似乎事件在锁屏上不起作用.
我想Post在提交模型实例时运行一个函数.我想在它们提交的任何时候运行它,所以我宁愿不在任何地方明确地调用该函数.我怎样才能做到这一点?
def notify_subscribers(post):
""" send email to subscribers """
...
post = Post("Hello World", "This is my first blog entry.")
session.commit() # How to run notify_subscribers with post as argument
# as soon as post is committed successfully?
post.title = "Hello World!!1"
session.commit() # Run notify_subscribers once again.
Run Code Online (Sandbox Code Playgroud) 我有以下RegEx:
[!?\.](.*)\.example\.com
Run Code Online (Sandbox Code Playgroud)
和这个示例字符串:
test foo abc.def.example.com bar ghi.jkl.example.com def
Run Code Online (Sandbox Code Playgroud)
我希望RegEx产品符合以下条件:def.example.com和jkl.example.com.我需要改变什么?应该在example.com的所有子域上工作.如果可能,它应该只采用第一个子域级别(abc.def.example.com- > def.example.com).
在regexpal上测试它,没有完全工作:(
我需要在此处更改什么才能使JavaScript代码与清单版本2和安全策略一起使用?
码:
function init()
{
chrome.tabs.getSelected(null, function(tab)
{
url = tab.url;
if(url.indexOf('chrome://') == -1 && url.indexOf('about:blank') == -1){
document.main.q.value = url;
}
});
}
Run Code Online (Sandbox Code Playgroud) javascript google-chrome google-chrome-extension content-security-policy
我使用jQuery 1.10.1与migrate,jQueryUI 1.10.3,jQueryValidate 1.11.1.
只是使用一个简单的表单,它有两个字段.在提交时,如果未提供值,则会显示一个带有消息的对话框.
问题:在IE 10中当用户尝试移动(拖动)错误消息对话框时,它只是向下移动.仅当浏览器窗口中出现垂直滚动条时才会发生这种情况.在Chrome 27中验证它有效.有时在Firefox 21和Opera 12.15中会出现同样的问题.
注意:它适用于jQuery UI 1.10.2只有问题在1.10.3中.
样本来源
<html>
<head>
<style type="text/css">
.label {width:100px;text-align:right;float:left;padding-right:10px;font-weight:bold;}
.label1 {width:350px; text-align:right; padding-top:300px;padding-bottom:30px; font-weight:bold; }
</style>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<!-- <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.min.js"></script> -->
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script>
$(function() {
$("#register-form").validate({
rules: { firstname: "required", lastname: "required" },
messages: { firstname: "Need First Name", lastname: "Need Last Name" },
showErrors: function(errorMap, errorList) {
$("#diverror").dialog({ modal: true });
},
submitHandler: function(form) { …Run Code Online (Sandbox Code Playgroud) 为什么这样做:
Options +ExecCGI
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.fcgi/$1 [L]
Run Code Online (Sandbox Code Playgroud)
但是,如果我远程RewriteCond它不起作用,我得到一个内部服务器错误.
Options +ExecCGI
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteRule ^(.*)$ /app.fcgi/$1 [L]
Run Code Online (Sandbox Code Playgroud)
如果我RewriteCond像这样修改它也不起作用.
RewriteCond %{REQUEST_FILENAME} !-l
Run Code Online (Sandbox Code Playgroud)
我想将所有请求重定向到app.fcgi.我不希望用户能够直接访问文件.
提前致谢!
我想覆盖text-align我的代码中的属性.我有这个HTML代码:
<style>
table { text-align: center; }
.align_left { text-align: left; }
</style>
<table>
<tr>
<td class="align_left">Align left ?</td>
<td>Align center ?</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
做这个的最好方式是什么?
package main
var lettersLower = []rune("abcdefghijklmnopqrstuvwxyz")
var lettersUpper = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
func main() {
x := append(lettersLower, lettersUpper)
}
Run Code Online (Sandbox Code Playgroud)
为什么这不起作用?我怎么能追加lettersLower和lettersUpper?
prog.go:7: cannot use lettersUpper (type []rune) as type rune in append
Run Code Online (Sandbox Code Playgroud)
我有这个表格:
<form action="http://targatesite.com" target="_blank" method="post" name="xyz" id="abc">
<input type="hidden" name="email" value="user_email" />
<input type="submit" name="sbmt" id="sbmt" value="user_value" class="user_class"/>
</form>
Run Code Online (Sandbox Code Playgroud)
假设有一个变量VAR。只有当VAR 的值为1时才能提交表单。
详细点击提交时,它将首先检查VAR的值,如果它返回true,则将提交并重定向到操作中给出的页面。如果它返回False它将显示一条消息,请检查 VAR 的值
Imp VAR 不是形式领域。我们从数据库中获取这个值。