Welcome Guest, Not a member yet? Register   Sign In
calling javascript function
#2

(12-09-2019, 08:09 PM)richb201 Wrote: My php code is running along fine. At some point I make this call:
$this->load->view("javascript_funcs_extensionloaded","snapshot_mode2");

$this->load->view($file, $data)  assumes that the file is a php file in the application/views folder.
If you have a javascript_funcs_extensionloaded.php file, which - on it's turn - loads a javascript file in your /js folder, make sure you make the correct reference to the js folder.
Best way IMO is:
PHP Code:
<script src="<?= base_url();?>js/script_filename.js" /> 
Put this code at the top of your view.
Reply


Messages In This Thread
calling javascript function - by richb201 - 12-09-2019, 08:09 PM
RE: calling javascript function - by Wouter60 - 12-10-2019, 12:02 AM
RE: calling javascript function - by richb201 - 12-10-2019, 06:19 AM
RE: calling javascript function - by Wouter60 - 12-10-2019, 07:02 AM
RE: calling javascript function - by InsiteFX - 12-10-2019, 08:55 AM
RE: calling javascript function - by richb201 - 12-10-2019, 08:01 PM
RE: calling javascript function - by richb201 - 12-11-2019, 02:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB