this little trick can be avoided by using FOSJsRoutingBundle to gain access to the routing component from within javascript. But it's too much overhead to pull in a whole new bundle just for this one case