Jump to content
Announcing Achievements! ×

Community

My JS doesnt work without IN_DEV..


Mac1
 Share

Recommended Posts

Hello, when im disabling IN_DEV mode, my custom loaded JS doesn't work.. What is a reason?
I'm loading they in my apps modules and in IN_DEV everything is good.

For example:
 

\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'somthing.js', 'appTest', 'front' ) );

File is located in:

appTest>dev>front>somthing.js

 

Edited by Mac1
Link to comment
Share on other sites

49 minutes ago, Mac1 said:

appTest>dev>front>somthing.js

appTest>dev>js>front>controllers>folder>ips.folder.function.js

\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_folder.js', 'appTest', 'front' ) );

// corrected

Edited by desti
Link to comment
Share on other sites

27 minutes ago, desti said:

appTest>dev>js>front>controllers>folder>ips.folder.function.js

\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_folder.js', 'appTest', 'front' ) );

// corrected

Wow, i'm trying this but doesn't work.
I have pushed JS to Applocation.php in init() and it works, but i don't want to do this that way.


Now it looks like:

dev/js/front/controllers/shop/ips.shop.something.js

\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'ips.shop.js', 'appTest', 'front' ) );
and every similar combination i tried..

 

Link to comment
Share on other sites

5 minutes ago, Mac1 said:

I didn't

Example I use:

JS is on applications/movies/dev/js/front/controllers/movies/ips.movies.submit.js

On JS:

;( function($, _, undefined){
	"use strict";

	ips.controller.register( 'movies.front.movies.submit', {
		initialize: function()

On template:

<form accept-charset='utf-8' class="ipsForm {$class}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} {{if settings.movies_tmdb_api_key}}data-ipsForm data-controller="movies.front.movies.submit"{{endif}}>

On a PHP file (applications/movies/modules/front/movies/submit.php) :

\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_movies.js', 'movies', 'front' ) );

 

Edited by Adriano Faria
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy