Welcome Guest, Not a member yet? Register   Sign In
JavaScript Frameworks integration with CI
#1

[eluser]Subekti Pranoto[/eluser]
is there any plan to integrate JavaScript Frameworks with CI in the future release?? i mean, in the single CI download (+JavaScript Frameworks) file. so far, i am not able to integrate JavaScript Frameworks with any instalation of CI.

i have made instalation of CI in the following:
www-root\javascript\Jquery\ - folder
www-root\javascript\prototype\ - folder
www-root\codeigniter\system\ - folder
www-root\codeigniter\index.php - file
this kind of structure is works.

but, it is not working if the the structure change like this:
www-root\codeigniter\javascript\Jquery\ - folder
www-root\codeigniterjavascript\prototype\ - folder
www-root\codeigniter\system\ - folder
www-root\codeigniter\index.php - file
#2

[eluser]Colin Williams[/eluser]
This is my two-step plan for using files in web sites (CI or not)

1.) Put the file somewhere public
2.) Reference the file appropriately!

Works every time Smile

(I'm guessing you have #2 wrong)
#3

[eluser]Subekti Pranoto[/eluser]
both of the structure, are publicly access.

structure #2
www-root\codeigniter\javascript\my_jscript\ - folder
www-root\codeigniter\javascript\my_jscript\script1.js - file
www-root\codeigniter\javascript\my_jscript\script2.js - file
www-root\codeigniter\javascript\Jquery\ - folder
www-root\codeigniterjavascript\prototype\ - folder
www-root\codeigniter\system\ - folder
www-root\codeigniter\index.php - file

i can access :
http://localhost/codeigniter/javascript/...script1.js
http://localhost/codeigniter/javascript/...script2.js
BUT:
everytime i create controller and views point to that link, THE PAGE DOESN't WORK well


structure #1
www-root\javascript\my_jscript\ - folder
www-root\javascript\my_jscript\script1.js - file
www-root\javascript\my_jscript\script2.js - file
www-root\javascript\Jquery\ - folder
www-root\javascript\prototype\ - folder
www-root\codeigniter\system\ - folder
www-root\codeigniter\index.php - file

i can access :
http://localhost/javascript/my_jscript/script1.js
http://localhost/javascript/my_jscript/script2.js
everytime i create controller and views point to that link, THE PAGE WORKS well

if the point is only publicly access, so ...
why in the structure #2, ALL PAGE dont work correctly???
why in the structure #1, ALL PAGE work correctly???
#4

[eluser]Colin Williams[/eluser]
Every path must resolve. Every one. What's probably happening is that in structure #2, your controller and views references are spot on, but there ARE references somewhere (maybe in the javascript files themselves) that are incorrect.

This is usually avoided by not hard-coding references anywhere. Use constants or variables or functions, etc.
#5

[eluser]Subekti Pranoto[/eluser]
have you try it??

for structure #2, i refrecence my javascript code using
<? echo base_url(); ?>

for structure #1, i use constant variable
<?
$my_sitename = 'http://localhost/';

.....

echo $my_sitename;
?>

both of that methode, can resolve correct path path.

BUT, AGAIN....
page with structure #2, the javascript always doesn't work. Why??
#6

[eluser]jdfwarrior[/eluser]
I have used jquery with CI numerous times. It's possible. From the root of my site, I have a public folder and a system folder (CI), I put jquery related stuff in a js folder, within public. Then I:

Code:
script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"
script type="text/javascript" src="/public/js/default.js"
#7

[eluser]jedd[/eluser]
[quote author="Subekti Pranoto" date="1238154208"]
http://localhost/codeigniter/javascript/...script2.js
everytime i create controller and views point to that link, THE PAGE DOESN't WORK well
[/quote]

Quote:http://localhost/javascript/my_jscript/script2.js
everytime i create controller and views point to that link, THE PAGE WORKS well

Well, it's either the lack of an exception for the javascript directory in your .htaccess file, or, as Colin observed, something is trying to hit /javascript somewhere within the script(s).
#8

[eluser]Subekti Pranoto[/eluser]
if the script (script2.js) is on
www-root\codeigniter\javascript\my_jscript\script2.js
every views page doesn't load as i want.

but, if the script (script2.js) is on
www-root\javascript\my_jscript\script2.js
every views page load as i want.
#9

[eluser]Subekti Pranoto[/eluser]
i have found link: http://code.google.com/p/codeigniter-jqu...loads/list
i even haven't test it, but it is like much more simplier.

is there any future plan to include that code (link above) in next distribution of CI, single file download of CI?? i think that code need to develop, but it gives me simplicity.
#10

[eluser]CroNiX[/eluser]
Why do you assume everyone wants to use jquery as their js framework? There are asset managers available for ci that handle this easily for js/css. Checkout [url="http://ellislab.com/forums/viewthread/101236/"]External Library[/url] for one.




Theme © iAndrew 2016 - Forum software by © MyBB