Welcome Guest, Not a member yet? Register   Sign In
js load file failed
#1

[eluser]joe_h[/eluser]
Hi all, I have the following problem: usually by js files in the index of my application

Example:
Code:
<script.... src=js/login.js

when I try to load the page I look at the firebug and can not find the js. I have to use a helper of CI or something?

Any idea???
#2

[eluser]CroNiX[/eluser]
Try not using a relative path.
#3

[eluser]joe_h[/eluser]
if I put the direct path when moving after server would have to edit it, however, and there I was testing.
#4

[eluser]CroNiX[/eluser]
Try starting your url's with a / so they start from site root instead of relative to current location. Or set a html base tag. Or define a javascript variable in the head of your document that gets assigned the value of site_url() and use that in your javascript.
#5

[eluser]InsiteFX[/eluser]
Code:
<head>
    <base href="<?php echo base_url();?>" />
</head>
#6

[eluser]joe_h[/eluser]
OK, I will try....




Theme © iAndrew 2016 - Forum software by © MyBB