Closed vladsavchuk closed 5 years ago
with recent ParsePage updates you could use:
$Config=<~config json noescape>;
or if you prefer not to have ParsePage tags directly in code and not to break syntax highlighting:
$Config=JSON.parse('<~config json noescape>');
Consider the following code in
onload.js
:$PS['js'] array only exists for
edit
action (existing entity with id), i.e. if it's notnew
. So, if I requestnew
action the $PS['js'] is empty and the browser throw JS-syntax error.What is the best way to deal with this?
Option 1:
Option 2:
Changes in the controller are undesirable for various reasons.
We need a good standard regarding exchanging data between back-end Controller and front-end Client. Probably using some common object in PS with initialization to setup default values.
At the moment it feels strange to me of using ParsePage tags in JS-files ... These tags break syntax highlighting and create linter errors in IDE.