Asset url
From Shopify Wiki
asset_url(input)
Returns the url for an asset.
Example:
{{ 'shop.css' | asset_url }}
The above example returns the absolute path plus filename of the specified file. In this case it could be something like: "http://cdn.shopify.com/s/files/1/0032/4552/assets/style.css?1255029188".
You will most probably use this url with another filter (to create a link or include tag for instance):
Example:
{{ 'style.css' | asset_url | stylesheet_tag }}
This would be something you would use in the html's head element and would result in something like:
<link href="http://cdn.shopify.com/s/files/1/0032/4552/assets/style.css?125502918" rel="stylesheet" type="text/css" media="all" />
In what file can I use the asset_url filter
You can use the asset_url filter in any .liquid file. So feel free to use the filter in a JavaScript file for example, provided that you have added a .liquid extension to it. Change the file extension from .js to .js.liquid, by renaming the file in your admin, and then you'll be set to point to images in your Assets folder in your JavaScript.
Now, why would you use the asset_url filter in a stylesheet? After all, relative URLs in stylesheets are interpreted relative to the source of the stylesheet, not relative to the document, so why would you need to use absolute URLs there anyway? Answer: you don't need to, but it's strongly recommended. Sometimes there are caching problems caused by the content delivery network (CDN), and you may get stuck with a modified image that won't update on your store front. Use the filter to link assets in your stylesheet like this:
background: url( {{'background.jpg' | asset_url }})
It's recommended that you use the asset_url filter for each url you link to in your stylesheet, even those not pointing to files uploaded through the theme editor. Don't worry: there is no hit in performance in your adding plenty of Liquid to your stylesheets.
Any .liquid file in /assets gets run through the Liquid renderer and the result is saved and sent to the browser with the same name but with the .liquid extension chopped off.

