我正在测试以下示例,通过登录并重定向到auth屏幕来验证用户身份 - http://jsfiddle.net/JMPerez/j1sqq4g0/
此示例使用带有以下脚本的回调页面:
(function() {
var hash = {};
window.location.hash.replace(/^#\/?/, '').split('&').forEach(function(kv) {
var spl = kv.indexOf('=');
if (spl != -1) {
hash[kv.substring(0, spl)] = decodeURIComponent(kv.substring(spl+1));
}
});
console.log('initial hash', hash);
if (hash.access_token) {
window.opener.postMessage(
JSON.stringify({
type:'access_token',
access_token: hash.access_token,
expires_in: hash.expires_in || 0
}),
'http://fiddle.jshell.net'
);
window.close();
}
})();
Run Code Online (Sandbox Code Playgroud)
在手机上试用时,它会在Safari中打开一个新标签.是否可以检查应用程序是否安装在iOS上并通过它登录?将使这个过程更快.
正如在这里的一个问题中看到的那样,它似乎已经解决但却无法理解触发它的原因是什么?- https://github.com/spotify/web-api/issues/718
谢谢!
My main model Tag
has a one-to-many relationship with Product
where one Tag
can have many Products
assigned to them via tag_id
relationship on the DB.
On my edit view, I am allowing users to edit the tag products
. These products can be added/edited/deleted on the form request.
Each product
field on the form is picked up from a request()
array. E.g: request('title'),request('price')
.
I have set $title[$key]
as the request('title')
array for example.
My thoughts next, was to …
我正在使用.on
单击功能来启用设置.我如何修改此单词,将(true)
值从false 切换为true,然后在下一次单击时再返回?
$("#myBtn").on('click', function(){
panorama.setVisible(true);
});
Run Code Online (Sandbox Code Playgroud)