Including Javascript
Posted: Wed May 19, 2021 5:30 pm
In reference to a previous couple of posts.
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=10850
and this post on page two:
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=10320
Can I access or load an external Javascript file from within the Custom code of an object?
The reason I'm asking about this is because I found that on a launch form that I have, I have a button that will run some code to erform an SQL search and then call another form to display the results. I found that the Custom code that is allowed seems to be limited in length. As I updated and added code to my Custom code on my button object, the bottoms rows were getting cut off. SO then I thought I would try to move the bulk of my JavaScript to an external file and I added the following code to the beginning of the Custom Code
Then when I clicked save I lost my form. I mean it actually disappeared from the forms list. Which means I lost all the code I had in that form. I checked the zzzzsys_object table and could see all of my objects that I had on that form were still there but the form was gone. I checked the zzzzsys_form table and it was gone from there too. So then I copied one of my existing forms and I changed the form_id to the same ID that my lost form had. When I then opened that form none of my objects were showing up. Upon further inspection of the bject list, I seen another ID field for the sob_all_zzzzsys_tab_id field. Then scanning thru the zzzsys_tab table that ID was nowhere to be found as well. so I again copied an existing record, changed the tab_ID and the form_id to the appropriate ID's adn now I got my form back and the objects and I have the code that was on my objects (including the button) but I still lost my code on the form itself. WOuld I find that original form anywhere else in the tables?
The only thing I can correlate to losing the form was the way I typed in the <script src...> tags. I used double quotes around that file name instead of single quotes. Could this have caused the loss of the form?
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=10850
and this post on page two:
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=10320
Can I access or load an external Javascript file from within the Custom code of an object?
The reason I'm asking about this is because I found that on a launch form that I have, I have a button that will run some code to erform an SQL search and then call another form to display the results. I found that the Custom code that is allowed seems to be limited in length. As I updated and added code to my Custom code on my button object, the bottoms rows were getting cut off. SO then I thought I would try to move the bulk of my JavaScript to an external file and I added the following code to the beginning of the Custom Code
Code: Select all
<script src="'myjsfile.js" type='text/javascript'></script>
The only thing I can correlate to losing the form was the way I typed in the <script src...> tags. I used double quotes around that file name instead of single quotes. Could this have caused the loss of the form?