Wednesday 15 April 2015

php - Code Igniter: Js file is included successfully, the script not working -


I am working on Code Igniter Framework. I have a PHP file:

  C: \ xampp \ htdocs \ mspn \ application \ views \ pengguna \ yes.php   

in my JS file:

  C: \ xampp Base-url in the config.php:    $ config ['base_url'] = '\' \ script: \ htdocs \ mspn \ tampilan \ js \ yes.js   

Http: // localhost / mspn ';

When I tried:

  & lt; Script src = "& lt ;? php echo base_url ('tampilan / js / yes.js') ;; & gt;" type = "text / javascript" & gt; & Lt; / Script & gt;   

The script is not working when it was tried in my browser. But when I checked the 'view-source' feature, and clicked on that link of that JS, it was pointing to the correct file. So I think the function is correct.

I have done the $ autoload ['assist'] = array ('url'); in autoload.php. And $ this-> Load-> Helper ('url'); in the admin file

I included the function for my CSS file, it worked. But it was not for the JS file. Now, I have been finally left to feel like I know what I did wrong. So what did I remember? Thank you.

I'm not an expert in JS, but after some time I get this, my experience is to check the script Loads with Firebug if you go with Firefox if you see

failed to load resource: server

  responded with network error: 404 not found - http: // localhost / yourpath   

Before correcting this, call your main tag as your head Try putting in the article.

It should still be in your header, your document may be ready () the luggage remains in the footer, see if it fixes your problem.

No comments:

Post a Comment