当我点击注销时...我在控制台中得到了这个异常:
FB.logout()在没有访问令牌的情况下调用.
问题:我已经在Session中保存了Access令牌,我也可以在客户端访问它.我已经检查了这个答案,并且无法理解我如何调用handleSessionResponse方法以及当我点击注销按钮时响应值是多少?/sf/answers/590146931/
我在布局页面(母版页)中有以下代码.
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '{!! env("FACEBOOK_APP_ID") !!}',
xfbml : true,
version : '{!! env("Facebook_Version") !!}'
});
FB.AppEvents.logPageView();
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Run Code Online (Sandbox Code Playgroud)
以下是刀片中的代码(内容页面)
<ul class="nav nav-sidebar">
<li class="active"><a href="#" onclick="logout();">Logout</a></li>
</ul>
<script>
function checkLoginState() {
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
} else {
} …Run Code Online (Sandbox Code Playgroud) facebook-javascript-sdk facebook-php-sdk laravel-5.3 laravel-5.4
我有一个由其子节点扩展的基本组件,但是当我们使用angular-cli在Angular中创建一个新的Component时,它会创建html和css文件,但我不会使用基本组件中的这些文件.
有没有办法创建一个没有HTML和CSS的基础组件?
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-base',
templateUrl: './base.component.html', //I dont need this
styleUrls: ['./base.component.css'] ////I dont need this
})
export class BaseComponent implements OnInit {
constructor() {}
ngOnInit() {}
}
import { Component } from '@angular/core';
import { BaseComponent } from '../base/base.component';
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css']
})
export class ChildComponent extends BaseComponent {
constructor() {
super();
}
ngOnInit() {
}
}
Run Code Online (Sandbox Code Playgroud) 我根据这个答案构建了我的应用程序的结构:
结合侧边菜单和标签:
我的app.js文件看起来像这样:
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
.state('app.tabs', {
url: '/tabs',
views: {
'menuContent': {
templateUrl: 'templates/tabs.html'
}
}
})
.state('app.tabs1.general', {
url: '/tabs1-general',
views: {
'general-tab': {
templateUrl: 'templates/general1.html',
controller: 'General1Ctrl'
}
}
})
.state('app.tabs2', {
url: '/tabs2',
views: {
'menuContent': {
templateUrl: 'templates/tabs2.html'
}
}
})
.state('app.tabs2.general', {
url: '/tabs2-general',
views: {
'general2-tab': {
templateUrl: 'templates/general2.html',
controller: 'General1Ctrl'
}
}
})
$urlRouterProvider.otherwise('/app/ofertas/ofertas-reporte');
Run Code Online (Sandbox Code Playgroud)
当我在otherwiseurlRouterProvider 的方法中测试设置路由的所有路由时,一切正常,但是当我在侧栏设置路由时,URL不匹配:
我的菜单在这里:
<ion-content>
<ion-list …Run Code Online (Sandbox Code Playgroud) 我有两个提交按钮和一个表单.如何检查我的jquery代码中选择了哪个提交按钮?
<% using (Html.BeginForm("UserInfo", "Home", FormMethod.Post, new { id = "formNext" })) { %>
....
<input id="submitHome" type="submit" name="goHome" value="Home" />
<input id="submitNext" type="submit" name="getNext" value="Next" />
<% } %>
$(document).ready(function() {
$('#formNext').submit(function() {
//Code Does not work but looking at something like this...
//$('#submitHome').click(function() {
// navigate to Home;
//});
//$('#submitNext').click(function() {
// return true;
//});
});
});
Run Code Online (Sandbox Code Playgroud) 我的表中有以下数据
id |name | option_data
1 |Joe |{"gender":"Male","cnic":"1234567","dob":"2016-03-14"}
2 |Doe |{"gender":"Male","cnic":"9999","dob":"2016-03-14"}
Run Code Online (Sandbox Code Playgroud)
如何以正确的 json_encode 格式获取数据。
例如,如果我写
echo json_encode($app->auth->users);
Run Code Online (Sandbox Code Playgroud)
option_data":"{\"gender\":\"Male\",\"cnic\":\"61101-6859110-3\",\"dob\":\"2016-03-14\"}"
Run Code Online (Sandbox Code Playgroud)
我的数据库列类型是Text. 如果我删除所有\使用stripslashes 仍然数据不是有效的JSON,因为它包裹在 "双引号中。
如何使用所有其他库以正确的 json_encode 格式获取数据。
我试图使我的回调 url 动态化,因为我在多身份验证系统中配置社交名流。我尝试使用socialiteproviders/manager如下:
$clientId = env($provider."_client_id");
$clientSecret = env($provider."_client_secret");
$redirectUrl = "the url i want";
$config = new \SocialiteProviders\Manager\Config($clientId,$clientSecret,$redirectUrl);
return Socialite::with($provider)->setConfig($config)->redirect();
Run Code Online (Sandbox Code Playgroud)
但它说:
调用未定义的方法 Laravel\Socialite\Two\FacebookProvider::setConfig()
尝试使用 facebook 登录时。
有人可以帮帮我吗?谢谢你。
javascript ×2
laravel ×2
angular ×1
angularjs ×1
asp.net-mvc ×1
eloquent ×1
html ×1
jquery ×1
json ×1
laravel-5.3 ×1
laravel-5.4 ×1
php ×1
typescript ×1