Welcome Guest, Not a member yet? Register   Sign In
How to link css and js file?
#1

[eluser]Mondal[/eluser]
Hello every one, I am pretty much new to codeigniter.
I am making a simple 2-3 pages site to understand codeigniter.
But i cant link my css and js file to every single view pages.
My folder structure is:
.application
.system
.assets
-- js
-- imgs
-- css
And i make header and footer differently in templates folder.
My views folder structure is:
.pages
-- home.php
-- aboutus.php
-- contactus.php
.templates
-- header.php
-- footer.php
.index.html
.welcome_message.php

I linked the css in header.php page, and when i run the pages on server, it works on home page, not working in about us page.
When i changed the link of css in header.php, then it works on about us page, not in home page.

1> how can i link css, js files to views, so that it works on every single pages.
2.> what should be the folder staructure for css, js?
3.> Is there any good note on that issue? please provide me the links.

I am waiting for your replies.
Please help me. I am in big trouble. I search a lot and try myself very much. But not getting any result.
So please help me on that issue.
I am waiting.
#2

[eluser]Alhazred[/eluser]
I link css and js in this way

Code:
//I'm using [ and ] here because otherwise the board removes the js code
[script type='text/javascript' src='<?php echo base_url('static/js/checkaddbuono.js'); ?]' >[/script]
<?php echo link_tag('assets/css/style.css'); ?>
of course there must be a rule in the htaccess to don't redirect the requests made on assets folder.
#3

[eluser]Mondal[/eluser]
@Alhazred...
thanks for the information..
But need some clarifications..i dont understand properly..Sad
please help me every one..i need your help..




Theme © iAndrew 2016 - Forum software by © MyBB