CodeIgniter Forums
base url in and script src doesnt work - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: base url in and script src doesnt work (/showthread.php?tid=54970)

Pages: 1 2


base url in and script src doesnt work - El Forum - 10-03-2012

[eluser]london77[/eluser]
Hello,

I found a nice date picker script and added that to my page. Everything works if the link is external to my site as below.

Code:
src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js">

However, I need to do a little change in this script , so I have created a java folder under my site folder('test').

www
test
..
application
css
java
...
But, somewhow when i link to here, script doesnt work.

here is how i coded it.
Code:
src="<?php echo base_url(); ?>java/jquery-ui.min.js">

and here is my config file

Code:
$config['base_url'] = 'http://localhost/test';

and url helper is added as well.

Please explain me where have i done wrong?

Thanks in advance.



base url in and script src doesnt work - El Forum - 10-03-2012

[eluser]solid9[/eluser]
Try this,

Code:
<src="&lt;?php echo base_url(application/java); ?&gt;" >







base url in and script src doesnt work - El Forum - 10-03-2012

[eluser]london77[/eluser]
no didnt work as well.
but thanks for the reply.


base url in and script src doesnt work - El Forum - 10-03-2012

[eluser]solid9[/eluser]
Try this,

Code:
<src="&lt;?php echo base_url(application/java/jquery-ui.min.js); ?&gt;" >
or this,
Code:
<src="&lt;?php echo base_url(/application/java/jquery-ui.min.js); ?&gt;" >


If this does not work try putting /java/ in the root of CodeIgniter Directory,
and called it like this way,

Code:
<src="&lt;?php echo base_url(java/jquery-ui.min.js); ?&gt;" >
or this,
Code:
<src="&lt;?php echo base_url(/java/jquery-ui.min.js); ?&gt;" >


just play with it if it doesn't work until you make it work.




base url in and script src doesnt work - El Forum - 10-03-2012

[eluser]london77[/eluser]
nope, none works Sad


base url in and script src doesnt work - El Forum - 10-03-2012

[eluser]Aken[/eluser]
Well what is the actual output, and what should it be? Start there.


base url in and script src doesnt work - El Forum - 10-04-2012

[eluser]london77[/eluser]
Normally when I use external src link it works. When it is clicked on the input field the date picker appears and i can choose a date from there.

When i use the internal link in a way mentioned above, nothing appears on click. I only see the form, nothing comes with the click.


base url in and script src doesnt work - El Forum - 10-04-2012

[eluser]london77[/eluser]
any help? Sad


base url in and script src doesnt work - El Forum - 10-04-2012

[eluser]Rolly1971[/eluser]
Code:
$config['base_url'] = 'http://localhost/test';

should be:

Code:
$config['base_url'] = 'http://localhost/test/';

then use in your src attribute:

Code:
&lt;?php echo base_url(); ?&gt;java/jquery-ui.min.js



base url in and script src doesnt work - El Forum - 10-04-2012

[eluser]london77[/eluser]
nope, that didnt work too.

Sad