Welcome Guest, Not a member yet? Register   Sign In
include javascript in CI4 view
#3

(This post was last modified: 11-11-2024, 11:07 AM by jcarvalho. Edit Reason: spelling errors )

(11-11-2024, 10:46 AM)That didnt worked, got 400 400 Bad Requestbecause the url generated was https://varziela.novoscanais.com/%3C? = $this->include('js/dtArtigos.js');?>inside the js file I have something like:<?php Wrote: $settingsxxx =  new \Config\Ncweb();
?>
and by the others methods I tried I got error, it looks like the js file cant do the settingsxxx
I use those settings to show/hide columns and format values... In CI3 was $this->config->item('xxxxx') and worked perfect


warcooftjs works with <script src="path/to/file"></script> tags, if your js file is inside a view just add a script tag to work around that. example <script src="<? = $this->include('js/dtArtigos.js');?>"></script>

To manage files better you might consider using the following library https://github.com/michalsn/minifier
Reply


Messages In This Thread
include javascript in CI4 view - by jcarvalho - 11-11-2024, 09:15 AM
RE: include javascript in CI4 view - by warcooft - 11-11-2024, 10:46 AM
RE: include javascript in CI4 view - by jcarvalho - 11-11-2024, 11:06 AM
RE: include javascript in CI4 view - by InsiteFX - 11-11-2024, 11:33 PM
RE: include javascript in CI4 view - by jcarvalho - 11-12-2024, 03:42 AM
RE: include javascript in CI4 view - by InsiteFX - 11-12-2024, 04:02 AM
RE: include javascript in CI4 view - by jcarvalho - 11-12-2024, 07:31 AM
RE: include javascript in CI4 view - by InsiteFX - 11-12-2024, 11:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB