where to put javascript |
[eluser]henrihnr[/eluser]
[quote author="Bramme" date="1225493203"]I can't believe how many people have problems understanding this. This must've come up a 1000 times allready.[/quote] cause CI have million newcomers... ![]()
[eluser]syntaxerror[/eluser]
Quote:Please do as inparo promote⦠no luck.... ![]()
[eluser]syntaxerror[/eluser]
i got it! i copy/paste the javascript directory after the base url. Code: C:\xampp\htdocs\DSValidator\javascript Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> maybe this will help to anyone who have the same issue. im sorry but i didnt made the [remove][/remove] tag. its in the forum thanks for all the help guys.
[eluser]alex-and-r[/eluser]
So I believe your javascript call is under [remove][/remove] tag? The forum engine cut it out? I have the same problem. I'm trying to link to the script (this one: http://www.numberoverflow.com/scripts/ja...placement/) and it seems that js isn't loading and i can't figure out why... Is it possible to describe your directory tree and where javascript is located and how do you link to it?
[eluser]Pascal Kriete[/eluser]
alex-and-r, base_url() gives you the path that you set in your config file. Then just add the rest of the path to the javascript file. Here's an example: [pre] public_html - ci -- index.php -- application -- javascript (js files go in here!) -- system [/pre] In this case base_url would give me example.com/ci (assuming I've set it correctly). So then I add javascript/filename.js. Code: <script src="<?= base_url(); ?>javascript/filename.js"></script> The easiest way to work out problems with this is to view the source of the rendered page, to see where it's going wrong.
[eluser]syntaxerror[/eluser]
make a directory of your js files in the root folder where system directory resides and i use this Code: src="<?php echo base_url(); ?>your js directory/mootools.js hope it will help you |
Welcome Guest, Not a member yet? Register Sign In |