作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 InAppBrowser for Cordova 与 Google 进行 oAuth,并且我需要检索当前 url 以存储访问 token 。我想知道是否有某个命令可以检索用户当前所在的 URL。我的代码:
window.open( authUri, { showLocationBar : false } );
window.open( authUri, { showLocationBar : false } ).addEventListener( 'loadstart', function() {
if ( event.url.indexOf( "code=" ) != -1 )
{
alert( "hey" );
var lel = URL;
}
});
window.open( lel, { showLocationBar : false } ).addEventListener( 'loadstart', $this.onAuthUrlChange );
window.open( lel, { showLocationBar : false } ).addEventListener( 'loadstop', $this.onAuthClose );
最佳答案
我遇到了同样的问题并使用类似的方法解决了
this.document.location.href
关于javascript - 如何在AppBrowser中检索当前所在的url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17202456/
我是一名优秀的程序员,十分优秀!