Welcome Guest, Not a member yet? Register   Sign In
base url in and script src doesnt work
#1

[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.
#2

[eluser]solid9[/eluser]
Try this,

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




#3

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

[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.

#5

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

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

[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.
#8

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

[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
#10

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

Sad




Theme © iAndrew 2016 - Forum software by © MyBB