@archaeous
There are several advantages to go my way of coding…
- Yes → You are right with the → onReady it is more simple & efficient.
- You never will loose connection to the wix-property-panel anymore.
- Code has better STYLING → better readable.
- Even more compact.
- You can devide in READY-SECTION and FUNCTIONs, like i do it always.
- You won’t have to jump-up & down all the way in your code, searching for some code-parts (at least you will scroll-up & down less).
- Time-saving coding…
- I do also not use to much spaces in my code…
bad:
$w.onReady( ( ) = > {
better:
$w.onReady(()=> {
The more compact and structured your code -->the better overview you will have
The better overview you will have → The better readable will be your CODE.
The better readable will be your CODE → The less BUGS will will find in your code
Logical way of thinking including logical conclusions
.
You will find more hints on how to code better, directly in your own CODE…
bad:
$w('#'+DATASET1').refresh();
$w('#'+DATASET2').refresh();
better:
$w('#'+DATASET1,'#'+DATASET2).refresh();
And so on…
Take care of your code-structure and syntax, and you will have less ERRORS, 4-sure!