来自Facebook Graph Api(https://developers.facebook.com/docs/reference/api/):
发布:您可以使用访问令牌通过向相应的连接URL发出HTTP POST请求来发布到Facebook图形.例如,您可以通过向https://graph.facebook.com/arjun/feed发出POST请求,在Arjun的墙上发布新的墙贴:
curl -F 'access_token=...' \
-F 'message=Hello, Arjun. I like this new API.' \
https://graph.facebook.com/arjun/feed
Run Code Online (Sandbox Code Playgroud)
非常感谢〜
// Create a state token to prevent request forgery.
// Store it in the session for later validation.
$state = md5(rand());
$app['session']->set('state', $state);
// Set the client ID, token state, and application name in the HTML while
// serving it.
return $app['twig']->render('index.html', array(
'CLIENT_ID' => CLIENT_ID,
'STATE' => $state,
'APPLICATION_NAME' => APPLICATION_NAME
));
Run Code Online (Sandbox Code Playgroud)
问题:如何在没有silex/twig的情况下进行服务器端工作?
这是一个基于示例构建的页面
<html>
<head>
<title>Demo: Getting an email address using the Google+ Sign-in button</title>
<style type="text/css">
html, body { margin: 0; padding: 0; }
.hide { display: none;}
.show { display: block;}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<!--<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script>-->
<script src="https://apis.google.com/js/client:plusone.js" type="text/javascript"></script>
<script type="text/javascript">
/*
* Triggered when the user accepts the sign in, cancels, or closes the
* authorization dialog.
*/
function loginFinishedCallback(authResult) {
if (authResult) {
console.log('authResult : ',authResult);
if (authResult['error'] == undefined){
gapi.auth.setToken(authResult); // Store the …
Run Code Online (Sandbox Code Playgroud) 我使用Jquery验证插件来验证下面的这两个输入元素.当输入无效时,插件将在输入字段后面生成标签标记,例如:<label for="company" style="">Required !</label>
问题:如何将错误消息放在已存在<span class="help-inline">
而不是生成新消息<label>
?
非常感谢您的帮助.
<script type="text/javascript">
$('#signUpForm').validate({
debug: false,
rules: {company:"required",username:"required"},
messages: {company:"Required !",username:"Required !"}
})// End of validate()
</script>
<div class="control-group">
<label class="control-label" for="company">Company Name</label>
<div class="controls">
<input type="text" name="company">
<label for="company">Required !</label> // -> this line is generated by Plug-In.
<span class="help-inline">(required)</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="username">User Name</label>
<div class="controls">
<input type="text" name="username">
<span class="help-inline">(required)</span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 使用光标(套索)绘制一个框将.item
在此JSFiddle示例中选择多个.
被选中.item
的人变成了拖延..slot
没有.item
内部的空是有效的droppable.
当您在多个droppable上放置多个draggable时,.item
如果相应的droppable无效,则只有哪个鼠标处于打开状态才会恢复.
如果删除无效的 droppable,如何使每个 draggable revert ?
使用Javascript:
$(function () {
// we are going to store the selected objects in here
var selected = $([]),
total = [],
offset = {
top: 0,
left: 0
};
$(document).selectable({
filter: ".item",
start: function (event, ui) { //remove draggable from selection, otherwise previous selection will still be draggable.
$(total).draggable("destroy");
},
selected: function (event, ui) { // push …
Run Code Online (Sandbox Code Playgroud) jquery jquery-ui jquery-ui-selectable jquery-ui-draggable jquery-ui-droppable
我已经部署了Google+登录按钮,现在我必须提供注销按钮,在此之前,我需要知道用户是否仍然已登录,然后我可以通过该按钮显示或隐藏此按钮.
我找到了这个文档:gapi.auth.checkSessionState(sessionParams,callback):https: //developers.google.com/+/web/api/javascript?hl = en #gapiauthchecksessionstatesessionparams_callback
有人可以演示如何使用它吗?
非常感谢.
我需要$('.mk[value=x]')
工作,但它确实$('.mk[value=1]')
没有.请有人帮忙
<body>
<span class="mk" value="1">1</span>
<span class="mk" value="1">1</span>
<span class="mk" value="3">3</span>
<input id="update" type="button" value="1" />
</body>
<script type="text/javascript">
$('#update').click(function(){
var x = this.value //--> x =1
$('.mk[value=x]').each(function(key, value) { //--> NOT WORKING !
$('.mk[value=1]').each(function(key, value) { //--> WORKING !
$(this).replaceWith('<span class="mk" value="2">2</span>')
});
})
</script>
Run Code Online (Sandbox Code Playgroud) 想创建这样的数组:
track[divID][wrapID]
Run Code Online (Sandbox Code Playgroud)
我无法使用 track[divID][wrapID] = wrapID
cos会在另一个循环中将更多内容添加到第二维,如下所示: track[divID][wrapID,wrapID2]
var track =[];
$("div").each(function() {
var wrapID = $(this).parent().attr('id')
var divID = $(this).attr('id')
track[divID].push(wrapID)
});
Run Code Online (Sandbox Code Playgroud)
错误是"Uncaught TypeError:无法读取未定义的属性'push'"
我做错了什么 ?非常感谢.
jquery ×4
google-plus ×3
api ×1
arrays ×1
curl ×1
facebook ×1
html ×1
javascript ×1
jquery-ui ×1
php ×1