Welcome Guest, Not a member yet? Register   Sign In
Asset helper?
#5

[eluser]pickupman[/eluser]
You don't even have to use the <base> tag. You just need a leading / before the resource. Prepending the tld as part of the asset URI will create a new DNS request that the browser will need to resolve to know where to find the file. This will load a minor amount of load time.
Code:
<link rel="stylesheet" type="text/css" href="/assets/css/resourcedb.css"  />

Adding the leading slash will always force the link to be relative to the document root of the site. Without the leading slash the path is relative to the last directory in the uri. With CI's uri structure, your css link will work for the home page, but will fail to resolve any page when there is a controller name shown. The browser see the controller name as a directory.

If your project has matured enough, you may find the Carabiner library in my signature helpful. It allows you to combine and minify css and js files.


Messages In This Thread
Asset helper? - by El Forum - 08-20-2010, 11:14 AM
Asset helper? - by El Forum - 08-20-2010, 11:29 AM
Asset helper? - by El Forum - 08-20-2010, 12:41 PM
Asset helper? - by El Forum - 08-20-2010, 01:04 PM
Asset helper? - by El Forum - 08-20-2010, 08:44 PM
Asset helper? - by El Forum - 09-02-2010, 11:11 AM
Asset helper? - by El Forum - 09-02-2010, 07:02 PM
Asset helper? - by El Forum - 09-02-2010, 09:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB