FOSJsRouting:路由.在Android设备上无法生成

FOSJsRouting: Routing.generate not working on Android devices

本文关键字:路由 Android FOSJsRouting      更新时间:2023-09-26

在我的Symfony2项目中,我在事件侦听器中使用路由。在我的台式机上一切正常,但在安卓设备上就不行了。我怎样才能使我的代码也为Android工作?

下面是我的代码:

$('.my-links a').click(function (e) {
            e.preventDefault();
            var setActive = {
                user: $(this).data('user')
            };
            console.log('on android code gets processed only until here, but not beyond');
            $.get(Routing.generate('_my_route', setActive, true)).success(function () {
                window.location = '{{ url('_some_other_route') }}';
            })
})

可能是因为在非开发版本中没有正确安装资产吗?

php app/console assets:install --symlink web

一切都开始工作,一旦我删除"true"…