0

Hi guys..i am just dealing with codeigniter framework..

Could you guys tell me where exactly should i put the ajax/javascript file in the codeigniter directory?

I mean could it be in the application folder or whatever, or it doesnt matter?
because i want to know which is the best practice to apply.

Thank you :)

2
Contributors
4
Replies
7
Views
6 Years
Discussion Span
Last Post by samsons17
0

By ajax you mean .js file? It doesn't matter. Put near all your .js files. I have a folder in root directory called js and there I put all js files.

P.S. hehe, 100 posts by me alredy :)

Edited by McLaren: n/a

0

By ajax you mean .js file? It doesn't matter. Put near all your .js files. I have a folder in root directory called js and there I put all js files.

P.S. hehe, 100 posts by me alredy :)

HI, thanks for answering me :)
em but i got one more question, regarding the ajax file, if i use the ajax with jquery then when i need to do for example like this :

type: "POST",
url: "<?php echo base_url();?>external/reply.php"

and my reply.php file is located in the root directory,and its require the database connection, will then i need to use the codeigniter database library whenever i want to interact with the database?because when i use the normal way without the codeigniter functions my codes wont work and i need to configure my database by making config.php file and then link it to my reply.php.

any help? thank you :)

0

ill then i need to use the codeigniter database library whenever i want to interact with the database?

I don't know. But why don't you put this code in some controller function and then use the CI's database functions?

Edited by McLaren: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.