0

嗨,我是 Cordova 又名 PhoneGap 的新手。我已经创建了一个 express.js 网站并尝试使用 Cordova 构建 ios 和 android 应用程序。

因此,只有一个网站。并且有 3 种方法(ios 应用程序、android 应用程序和网络浏览器)来解决这个问题。

我想弄清楚什么是方法,并在快速路线中提供不同的布局。

在 http 标头中,android 设备发送'x-requested-with': 'com.example.hello'但 iOS 没有。在客户端 js 中可以使用 loacation.href 但在 express.js 中无法读取 location.href。

有没有办法找出 express.js 中的方法类型?

4

2 回答 2

0
app.get('/', function(req, res){
  // console.log(req.headers);
  console.log('User-Agent: ' + req.headers['user-agent']);
});
于 2014-04-07T22:02:14.163 回答
-2

试试这个 jxcore,它可能对你的项目有用!^_^

[ https://www.sitepoint.com/how-to-run-node-js-with-express-on-mobile-devices/]

于 2016-10-02T15:23:18.817 回答