Welcome Guest, Not a member yet? Register   Sign In
where to write JS code
#1

[eluser]Mitja B.[/eluser]
What you suggest where to write JS code.

The code like this

Code:
[removed]
$(function(){
    $("form input[@type='text']").addClass("input");
    
    $(".date-pick").css("width", "100px");
    $("input[@name='duration_in_hour'], input[@name='number_of'], input[@name='price_eur'], input[@name='price_eur_simobil']").css("width", "70px");
});
[removed]

to write it in view file or in controller file.

If in controler where

Code:
function content_add()
{
...

$this->load->view('admin/content_add', $data);    
}


thx
#2

[eluser]manilodisan[/eluser]
Why should you use PHP to load js?
#3

[eluser]Mitja B.[/eluser]
i can load it in .html too. But i load page with view. How can i load js then?
#4

[eluser]manilodisan[/eluser]
By placing the normal js link in the view?!




Theme © iAndrew 2016 - Forum software by © MyBB