Welcome Guest, Not a member yet? Register   Sign In
Loading external JS file
#1

[eluser]mzvasiq[/eluser]
I'm trying to load an external JS file in my Login view with the following code

Code:
script type="text/javascript" src="<?php echo base_url();?>javascript/adminScripts.js"

The javascript folder is inside the 'application' folder. I don't know what is the problem because i searched on Google and everyone uses this same code to include external files.

The Server says '404 Error'.

I looked it up a lot on this code but still I'm unable to figure out why am i getting a 404 Error.
#2

[eluser]noideawhattotypehere[/eluser]
Application folder is blocked with htaccess (by default), you shouldnt put any assets in there.

Another thing is that, base_url != base_url/application :p
#3

[eluser]mzvasiq[/eluser]
So if i want to put an External Js file then where should i put it?

There's a .htaccess file in the application folder though which says "Deny from all"
#4

[eluser]mzvasiq[/eluser]
I understood the problem now.. Thanks
It's working now Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB