EllisLab text mark
Advanced Search
1 of 2
1
   
base url in and script src doesnt work
Posted: 03 October 2012 06:25 PM   [ Ignore ]
Joined: 2011-12-13
20 posts

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.

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.

src="<?php echo base_url(); ?>java/jquery-ui.min.js"

and here is my config file

$config['base_url''http://localhost/test'

and url helper is added as well.

Please explain me where have i done wrong?

Thanks in advance.

 

 
Posted: 03 October 2012 06:59 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-08
524 posts

Try this,

<src="<?php echo base_url(application/java); ?>" 

 

 

 

 Signature 

Stick with it, practice it and have fun with it.

 
Posted: 03 October 2012 08:00 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

no didnt work as well.
but thanks for the reply.

 
Posted: 03 October 2012 08:23 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-08
524 posts

Try this,

<src="<?php echo base_url(application/java/jquery-ui.min.js); ?>" 

or this,

<src="<?php echo base_url(/application/java/jquery-ui.min.js); ?>" 


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

<src="<?php echo base_url(java/jquery-ui.min.js); ?>" 

or this,

<src="<?php echo base_url(/java/jquery-ui.min.js); ?>" 


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

 

 Signature 

Stick with it, practice it and have fun with it.

 
Posted: 04 October 2012 01:02 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

nope, none works :(

 
Posted: 04 October 2012 01:21 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-11-28
2435 posts

Well what is the actual output, and what should it be? Start there.

 
Posted: 04 October 2012 04:00 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

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.

 
Posted: 04 October 2012 06:11 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

any help? :(

 
Posted: 04 October 2012 06:57 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2010-06-27
134 posts
$config['base_url''http://localhost/test'

should be:

$config['base_url''http://localhost/test/'

then use in your src attribute:

<?php echo base_url(); ?>java/jquery-ui.min.js 
 Signature 

“I Reject Your Reality and Substitute My Own” - Adam Savage, M5 Inc

 
Posted: 04 October 2012 07:09 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

nope, that didnt work too.

:(

 
Posted: 04 October 2012 08:06 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-08
524 posts

I think this is a jQuery-UI issue.

Can you post your jQuery codes for this.

 Signature 

Stick with it, practice it and have fun with it.

 
Posted: 08 October 2012 10:37 AM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

hi,

unfortunately the file is too large to copy paste here.


here is the link, if you kindly check it for me.

java code

 
Posted: 08 October 2012 10:49 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-25
1009 posts

When you have a look at the sourcecode rendered by the browser
the js file is usually linked. If you get the source of the
js file following the link the error is elsewhere.

If the link doesn’t work please post the line (path/js_file.js)
rendered by your browser.

 
Posted: 08 October 2012 11:27 AM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Joined: 2011-12-13
20 posts

hi LuckFella73

thanks for the reply, but I didnt understand what you are saying at all.
can you kindly explain it a bit clearly please.

 
Posted: 08 October 2012 12:39 PM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Joined: 2011-02-23
882 posts

Paste the source code of your rendered page by right clicking in your browser and then “view source”. Copy the lines of your <head>-part or wherever you want the js file to be included at.

 Signature 

ignited Community Framework (WiP)  |  Read the User’s Guide. It won’t bite.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

CI example .htaccess

 
Posted: 08 October 2012 03:14 PM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Joined: 2011-11-13
96 posts

Try this it works for me:-

The s stands for script in the following:-

<s type="text/javascript" src="<?=base_url()?>java/jquery-ui-1.8.24.custom.min.js"></s

Do have the correct permissions for the java folder. Also is your .htaccess file stopping you entering the folder.

Can you see the contents of the folder if you do http://localhost/java ?

These are just some of things I would check first.

 
1 of 2
1