Javascript order of execution
Posted: Fri Nov 09, 2018 11:17 am
Hi there,
I have a couple of problems I'm trying to understand.
1) Where's the best place to put a js 'src' library tag that's specific to a particular form?
--If I add it to the HTML object that's using it I get a console 'ReferenceError' for the library usage in the HTML object the FIRST time I log in and go to that form, after that it is fine.
--If I add the library to the 'Header' in the setup it seems to work, but I'm wondering if this is the 'right' solution
--I'd like to understand this so I don't keep hitting it in the future
2) I create a string in PHP in a forms 'Before Edit' event, at the end of the PHP I pass this string to a JavaScript variable with nuAddJavascript, but the HTML object that uses the variable gets a 'ReferenceError' the first time I enter the edit form.
They seem like related issues? Any guidance is appreciated!
I have a couple of problems I'm trying to understand.
1) Where's the best place to put a js 'src' library tag that's specific to a particular form?
--If I add it to the HTML object that's using it I get a console 'ReferenceError' for the library usage in the HTML object the FIRST time I log in and go to that form, after that it is fine.
--If I add the library to the 'Header' in the setup it seems to work, but I'm wondering if this is the 'right' solution
--I'd like to understand this so I don't keep hitting it in the future

2) I create a string in PHP in a forms 'Before Edit' event, at the end of the PHP I pass this string to a JavaScript variable with nuAddJavascript, but the HTML object that uses the variable gets a 'ReferenceError' the first time I enter the edit form.
They seem like related issues? Any guidance is appreciated!