Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
Is it possible to conditionally load @include files?
Can @include js files be added conditionally (just wrapped in an if/then) or are they always loaded?
Official
Response
-
EMPLOYEE
1Unfotunately we don't support this at the moment as all includes are being executed at the beginning of the loading process.
What you can do, in the meanwhile, is add the conditional inside the include, for example: different code for each platform.
-
EMPLOYEE
1Unfotunately we don't support this at the moment as all includes are being executed at the beginning of the loading process.
What you can do, in the meanwhile, is add the conditional inside the include, for example: different code for each platform. -
Loading Profile...





So far we saw the need for different includes for different platform and this (as mentioned) can be solved by adding all platforms code into the include and doing something like this:
if (appAPI.platform == "IE") {
//your IE code
} else if (appAPI.platform == "FF") {
//your FF code
} else if (appAPI.platform == "CH") {
//your Chrome code
} else {
//your code for any platform which is not supported yet by Crossrider
}