You should then use JmikolaJsAssetsHelperBundle.
which allows you to expose the AssetsHelper
service from Symfony2's templating component to JavaScript.
It supports both relative and absolute asset URI(s).
Example,
Once configured, the bundle creates a AssetsHelper
global variable within your javascript. It allows you then to call a getUrl()
helper to build your asset path as follow,
'<img src="' + AssetsHelper.getUrl('/images/yourImage.png') + '">';