Welcome Guest, Not a member yet? Register   Sign In
javascript calling controler without form
#6

[eluser]attos[/eluser]
PHP does not render the js, it's the server.

Now, about including your external files there are several ways of doing this.

One is having your js files under a directory under the web root. In this case your directory structure would be:

Code:
web_root
|
+- js
|   +- (All your javascript files)
+- index.php
+- system
     +- application
     |

In this case you would be able to use the following in your view:

Code:
<script type="text/javascript" src="/js/YOUR_JS_FILE.js" />

Another possibility is to have your external files under your application's directory:

Code:
+- index.php
+- js
|   +- (All your javascript files)
+- system
     +- application
     |

In this case you would need to load the uri helper in your controller and you can use the following in your view:

Code:
<script type="text/javascript" src="<?php echo base_url() ?>js/YOUR_JS_FILE.js" />

You can do the same with css files.

I hope this works.


Messages In This Thread
javascript calling controler without form - by El Forum - 09-24-2009, 02:13 PM
javascript calling controler without form - by El Forum - 09-25-2009, 07:21 AM
javascript calling controler without form - by El Forum - 09-25-2009, 10:08 AM
javascript calling controler without form - by El Forum - 09-29-2009, 07:45 AM
javascript calling controler without form - by El Forum - 09-29-2009, 07:33 PM
javascript calling controler without form - by El Forum - 09-30-2009, 02:09 PM
javascript calling controler without form - by El Forum - 10-01-2009, 09:45 AM
javascript calling controler without form - by El Forum - 10-01-2009, 09:48 AM
javascript calling controler without form - by El Forum - 10-01-2009, 11:06 AM
javascript calling controler without form - by El Forum - 10-01-2009, 11:25 AM
javascript calling controler without form - by El Forum - 10-09-2009, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB