how to put javascript?? |
[eluser]husni[/eluser]
well..this is my structure.. Code: ... i put the folder javascript at the wwwroot.. i'll try to put the folder in my view folder just like you do.. *but i don't have .htaccess file..
[eluser]maria clara[/eluser]
here’s my .htaccess maybe this can help RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php/$1 [L]
[eluser]husni[/eluser]
i'll try the .htaccess after my javascript works.. i put my folder named javascript in view folder.. i put this code into my controller.. Code: $this->load->view('javascript/example.js'); this is my example.js file Code: function peringatan() but the alert didn't appeared at all.. is my view file still need this?? Code: <type="text/javascript" src="<?=base_url()?>javascript/example.js">[removed]
[eluser]maria clara[/eluser]
ur calling a .js file from ur view to ur controller like this: Code: $this->load->view('javascript/script.js'); for example this is the code inside ur .js file Code: function js() Quote:
[eluser]husni[/eluser]
yup! thats right.. it doesn't works.. and in my view file,it copy the coding and display the javascript code.. function peringatan() { alert('Hello hehe'); }.. how can i fix the problem?
[eluser]maria clara[/eluser]
i have found a thread that may help a lot. check this thread http://ellislab.com/forums/viewthread/45055/ |
Welcome Guest, Not a member yet? Register Sign In |