Welcome Guest, Not a member yet? Register   Sign In
How to atatch a JavaScript File? (
#3

[eluser]ELRafael[/eluser]
1. Use the search form.
2. Use base_url()
Code:
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/styles.css" />
<write_here_script type="text/javascript" src="&lt;?php echo base_url();?&gt;js/jquery-1.4.2.min.js"></write_here_script>

Sometimes (or many times?) I have this kind of structure:
http://localhost/project_name
or
http://project_name.local/
or
http://production_env/~project_name/
and finally
http://www.project_name.tld/

So,base_url() is a good friend :lol:


Messages In This Thread
How to atatch a JavaScript File? ( - by El Forum - 08-03-2010, 06:38 AM
How to atatch a JavaScript File? ( - by El Forum - 08-03-2010, 06:56 AM
How to atatch a JavaScript File? ( - by El Forum - 08-03-2010, 10:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB