window.location.hash变量如果我有一个像如何获得在node.js中
www.example.com/path#one=a1&two=a2&three=a3
一个URL如何直接从node.js的网址检索变量? 因为我使用ExpressJS,我尝试使用req.query.variable(和req.params.variable),但那不会工作...
我的实际问题是从Facebook获取访问令牌,通过使用客户端身份验证(https://developers.facebook.com/docs/authentication/client-side/),但该网址重定向到的结构为这样:
YOUR_REDIRECT_URI#
access_token=USER_ACCESS_TOKEN
&expires_in=NUMBER_OF_SECONDS_UNTIL_TOKEN_EXPIRES
而且我不知道如何从url中获取参数...
url = require('url'); var url_parts = url.parse(urlString); console.log(url_parts); –