Do I need to escape the semi-colon?

In my live site, when a page element containing semi-colons as visual separators is assigned to a string variable the code stops running and throws a TypeError in Site Monitoring similar to what you see below (sorry for the length of this thing). My workaround is to use an ellipses (…) as the separator. I read about escaping special characters but as far as I know a semi-colon is NOT a special character in JavaScript. Is it in Wix? Do I need to somehow escape it to use it in a string?

Most Site Monitoring items I can read, but this one is very unusual. Can you point me to some documentation on how to read this sort of error message?

“jsonPayload”: {
“message”:
“TypeError: Illegal invocation at I (eval at evaluateBundle ( https://jimyaccino.wixsite.com/_partials/wix-thunderbolt/dist/clientWorker.db0da9b0.bundle.min.js:2:94402 ), :3:15237) at h (eval at evaluateBundle ( https://jimyaccino.wixsite.com/_partials/wix-thunderbolt/dist/clientWorker.db0da9b0.bundle.min.js:2:94402 ), :3:16873) at Object.get text [as text] (eval at evaluateBundle ( https://jimyaccino.wixsite.com/_partials/wix-thunderbolt/dist/clientWorker.db0da9b0.bundle.min.js:2:94402 ), :3:17236) at Object.keys.reduce.c.value.c.get.d.get [as text] (eval at evaluateBundle ( https://jimyaccino.wixsite.com/_partials/wix-thunderbolt/dist/clientWorker.db0da9b0.bundle.min.js:2:94402 ), :3:56474) at https://bundler.wix-code.com/f5624679-9c3d-4fff-bd20-001da4d1091d/ad41a5b7-ef45-4da3-bc5e-80473e63f59f/44c23ede-c345-4b78-8999-47f2e0122716/pages/gkutr.js?dependencies-token=3938:1:7348 at Array.forEach () at https://bundler.wix-code.com/f5624679-9c3d-4fff-bd20-001da4d1091d/ad41a5b7-ef45-4da3-bc5e-80473e63f59f/44c23ede-c345-4b78-8999-47f2e0122716/pages/gkutr.js?dependencies-token=3938:1:7110 at Array.forEach () at _ ( https://bundler.wix-code.com/f5624679-9c3d-4fff-bd20-001da4d1091d/ad41a5b7-ef45-4da3-bc5e-80473e63f59f/44c23ede-c345-4b78-8999-47f2e0122716/pages/gkutr.js?dependencies-token=3938:1:6070 ) at e. ( https://static.parastorage.com/services/wix-code-viewer-app/1.1479.164/app.js:25:3915 )”
}

What is the string that you have in the page element? I need an example in order to understand the issue.

Here is an example you asked for. I obtained this by running an older version of the site…

sku: 8040.725.002; price: $130.00; Carlson Label Fiberglass Tripod…

sku: 8040.725.004; price: $290.00; Carlson Wooden Tripod w/ Dual Clamp…

Also, where can I find documentation on deciphering the TypeError payload I reported above?

I tried this in a TextBox and it works fine.

Please explain what you are doing. What screen element are you using? Share your code so we can see what you’re doing.

Text box. This posting describes in detail what I am doing.

May I point you to this discussion where Paul Krzyz and I went through some rigorous testing and I finally homed in on the solution that worked? I copied this link to the place where I declared (possible wrongly) the solution.

https://www.wix.com/velo/forum/coding-with-velo/truncation-problems?appSectionParams=%7B%22origin%22%3A%22member_posts_page%22%7D

The reason I am bringing this up now it is that, like Wix, I too find it hard to believe I could have discovered a “real” bug and therefore need help. However, if it is a bug, my hope is that Wix would work on it, or provide a workaround, for the sake of the user community.

Note my most recent postings are all related to the fact that my code works perfectly in Preview mode but fails in Publish mode.

It is great that you are supporting users in this community. I am very grateful and look forward to your and others comments. It would be even better to be able to discuss with a knowledgeable person about such coding nuances. However with thousands of people needing help, I do realize that is not really possible in a company the size of Wix.

I took a look at the other thread, but it really isn’t clear to me what the solutions is, since I don’t understand what the problem is.

You stated, “when a page element containing semi-colons as visual separators is assigned to a string variable the code stops running and throws a TypeError”. I’m trying this but I don’t see the problem. I have a TextBox with the example string that you posted, I set it to a variable, and display it in the console. All works fine.

OK - so now I know you are using a TextBox. What is the code that you have where you set the contents of the element to a string variable? I would like to try this out myself to identify the problem. Please provide a minimum scenario where I can see the problem. This is what Customer Care and QA will request.

Its below in the variable called “labelSoftware”. Notice here I am putting in the “…”. If I plug in “;” I can duplicate the error.

Do you have access to any documentation related to how to understand the error uncovered in Site Monitoring?

If you wish I invite you to open the website to see all the code.

async function populateCheckboxes ( sel , selectedProduct , gpsOnly ) {
//function populateCheckboxes (sel, selectedProduct, gpsOnly) {
//console.log("…in async populateCheckboxes…sel, selectedProduct, gpsOnly: ", sel + " , " + selectedProduct + " , " + gpsOnly);
//console.log("In populateCheckboxes with: ", sel, selectedProduct, gpsOnly)
let accessory = 0
let software = 0 ;
let optionsSoftware = []
let optionsAccessory = []

// if gpsOnly = true, then reset Optional Software price to 0 

// Here I converted my populateCheckboxes to an ASYNC function, 
//  and added the AWAIT statement to complete the Promise before going on. 
**const**  results  =  **await**  wixData . query ( "OptionalProducts" ) 
    . eq ( "productName" ,  selectedProduct )  // Query the "name" field for the selected "prodName" 
    . find (); 
//    wixData.query("OptionalProducts") 
//  .eq("productName",selectedProduct)                      // Query the "name" field for the selected "prodName" 
//  .find() 
//  .then( (results) => { 
//console.log("populateCheckboxes: results.items: , selectedProduct, gpsOnly?", results.items + " , " + selectedProduct + " , " + gpsOnly); 
//console.log("populateCheckboxes: results.items.length,  results.items: ", results.items.length, results.items); 
//console.log(results.items.length, results.items) 

**if**  ( selectedProduct  !==  **undefined** ) { 
    **for**  ( **let**  i  =  0 ;  i  <  results . items . length ;  i ++) { 
        **let**  product  =  results . items [ i ]. productName ; 
        **if**  ( product  ===  selectedProduct ) { 
            //console.log ("inside second For i loop", i) 
            //console.log ("results.items: ",results.items) 
            //console.log("productName: ",results.items[i].productName); 
            //console.log("fieldSoftware name: ",results.items[i].fieldSoftware); 
            //console.log("alias name: ",results.items[i].alias); 
            //console.log("accessory name: ",results.items[i].accessory); 
            **let**  labelSoftware  =  results . items [ i ]. fieldSoftware ; 
        //Software labels 
            **if**  ( labelSoftware  !==  **undefined**  &&  gpsOnly  !==  **true** ) {   //then tsOnly selected 
               **let**  labelPrice  =  numberToMoney ( results . items [ i ]. price ) 
                labelSoftware  =  "sku: "  +  results . items [ i ]. sku  +  "...   price: "  +  labelPrice  +  "...    "  +  labelSoftware 
                //console.log ("xxxxxxx Software checkboxes      label, gpsOnly: ", labelSoftware, gpsOnly); 
                **let**  price  =  moneyToNumber ( results . items [ i ]. price ) 
                **let**  alias  =  results . items [ i ]. alias 
                software  =  software  +  1 
                optionsSoftware  =  optionsSoftware . concat ({  "label" :  labelSoftware ,  "value" :  price ,  "alias" :  alias  });  //The price is saved here as the value of the checkbox 
                //console.log("software label, value (price) added to box's text: ", results.items[i].fieldSoftware + " added to box" + i , alias, optionsSoftware)   ; 
            }  **else if**  ( labelSoftware  !==  **undefined**  &&  gpsOnly  ==  **true** ) {   //then gpsOnly selected 
               // allow only roading 
               **let**  labelPrice  =  numberToMoney ( results . items [ i ]. price ) 
                labelSoftware  =  "sku: "  +  results . items [ i ]. sku  +  "...   price: "  +  labelPrice  +  "...    "  +  labelSoftware 
                //console.log ("xxxxxxx Software checkboxes      label, gpsOnly: ", labelSoftware, gpsOnly); 
                **let**  price  =  moneyToNumber ( results . items [ i ]. price ) 
                **let**  alias  =  results . items [ i ]. alias 
                //if (alias == "roading") {  //then add label 
                    software  =  software  +  1 
                    optionsSoftware  =  optionsSoftware . concat ({  "label" :  labelSoftware ,  "value" :  price ,  "alias" :  alias  });  //The price is saved here as the value of the checkbox 
                    //console.log("software label, value (price) added to box's text: ", results.items[i].fieldSoftware + " added to box" + i , alias, optionsSoftware)   ; 
                //} 
            } 
        //Accessory labels 
            **let**  labelAccessory  =  results . items [ i ]. accessory ; 
            **if**  ( labelAccessory  !==  **undefined** ) { 
                **let**  labelPrice  =  numberToMoney ( results . items [ i ]. price ) 
                labelAccessory  =  "sku: "  +  results . items [ i ]. sku  +  "...   price: "  +  labelPrice  +  "...    "  +  labelAccessory 
                //console.log("xxxxxxx accessories checkboxes        label, gpsOnly: ", labelAccessory, gpsOnly); 
                **let**  alias  =  results . items [ i ]. alias 
                **let**  price  =  moneyToNumber ( results . items [ i ]. price ) 
                accessory  =  accessory  +  1 
                optionsAccessory  =  optionsAccessory . concat ({  "label" :  labelAccessory ,  "value" :  price ,  "alias" :  alias  });  //The price is saved here as the value of the checkbox 
                //console.log("accessory label added to box: ", results.items[i].accessory, alias, optionsAccessory); 
            } 
        } 
    } 
    //console.log ("cccccccccc            concatenated options = ") 
    //console.log('#' + sel + 'Software' + " , " + '#' + sel + 'Accessory' + " , " + '#' + sel + 'GroupCheckbox') 
    $w ( '#'  +  sel  +  'Software' ). options  =  optionsSoftware ; 
    $w ( '#'  +  sel  +  'Accessory' ). options  =  optionsAccessory ; 

    //console.log("................Number of software & accessory items = ", software, accessory) 
/* 
    if (selGnss == false && selInstrument == false && gpsOnly ==true) { //When these conditions are true, then shut down software 
        software = 0 
    } 
*/ 
    **if**  ( software  >>  0  &&  accessory  ==  0  ) {   // Software but no Accessories 
        //console.log("mmmmmmoooooo  optionsSoftware.length ", optionsSoftware.length) 
        $w ( '#'  +  sel  +  'Optional' ). text  =  "Select optional software.  No accessories available" 
        $w ( '#'  +  sel  +  'Optional' ). expand (); 
        $w ( '#'  +  sel  +  'Optional' ). show (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). expand (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). show () 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). expand (); 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). show () 
        //shut off accessory since it is 0 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). hide (); 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). collapse (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). hide (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). collapse () 


        **for**  ( **let**  i  =  0 ;  i  <  optionsSoftware . length ;  i ++) { 
            //console.log("xxxxxxxxooooooo  i, optionsSoftware[i].label ==> ", i, '#' + sel + 'SoftwareText' + i, optionsSoftware[i].label) 
            $w ( '#'  +  sel  +  'SoftwareText'  +  i ). text  =  optionsSoftware [ i ]. label 
            $w ( '#'  +  sel  +  'SoftwareAlias'  +  i ). text  =  optionsSoftware [ i ]. alias 
            $w ( '#'  +  sel  +  'Software'  +  i ). value  =  optionsSoftware [ i ]. value 
            $w ( '#'  +  sel  +  'SoftwareText'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'SoftwareText'  +  i ). show () 
            $w ( '#'  +  sel  +  'Software'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'Software'  +  i ). show () 
        } 

    } 
    **if**  ( software  ==  0  &&  accessory  >>  0  ) {   // no Software but Accessories 
        //console.log("zzzzzzzoooooo  optionsAccessory.length ", optionsAccessory.length) 
        $w ( '#'  +  sel  +  'Optional' ). text  =  "Select accessories.  No optional software available" 
        $w ( '#'  +  sel  +  'Optional' ). expand (); 
        $w ( '#'  +  sel  +  'Optional' ). show (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). expand (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). show () 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). expand (); 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). show () 
        //shut off software since it is 0 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). hide (); 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). collapse (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). hide (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). collapse (); 

        **for**  ( **let**  i  =  0 ;  i  <  optionsAccessory . length ;  i ++) { 
            //console.log("mmmmmmooooooo  i, optionsAccessory[i].label ==> ", i, '#' + sel + 'AccessoryText' + i, optionsAccessory[i].label) 
            $w ( '#'  +  sel  +  'AccessoryText'  +  i ). text  =  optionsAccessory [ i ]. label 
            $w ( '#'  +  sel  +  'AccessoryAlias'  +  i ). text  =  optionsAccessory [ i ]. alias 
            $w ( '#'  +  sel  +  'Accessory'  +  i ). value  =  optionsAccessory [ i ]. value 
            $w ( '#'  +  sel  +  'AccessoryText'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'AccessoryText'  +  i ). show () 
            $w ( '#'  +  sel  +  'Accessory'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'Accessory'  +  i ). show () 

        } 
    } 

    **if**  ( software  >>  0  &&  accessory  >>  0  ) {   // Software and Accessories 
        //console.log("zzzzzzzoooooo  optionsAccessory.length ", optionsAccessory.length) 
        $w ( '#'  +  sel  +  'Optional' ). text  =  "Select optional software and accessories." 
        $w ( '#'  +  sel  +  'Optional' ). expand (); 
        $w ( '#'  +  sel  +  'Optional' ). show (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). expand (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). show () 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). expand (); 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). show () 
        $w ( '#'  +  sel  +  'GroupSoftware' ). expand (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). show () 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). expand (); 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). show () 

        **for**  ( **let**  i  =  0 ;  i  <  optionsSoftware . length ;  i ++) { 
            //console.log("xxxxxxxxooooooo  i, optionsSoftware[i].label ==> ", i, '#' + sel + 'SoftwareText' + i, optionsSoftware[i].label) 
            $w ( '#'  +  sel  +  'SoftwareText'  +  i ). text  =  optionsSoftware [ i ]. label 
            $w ( '#'  +  sel  +  'SoftwareAlias'  +  i ). text  =  optionsSoftware [ i ]. alias 
            $w ( '#'  +  sel  +  'Software'  +  i ). value  =  optionsSoftware [ i ]. value 
            $w ( '#'  +  sel  +  'SoftwareText'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'SoftwareText'  +  i ). show () 
            $w ( '#'  +  sel  +  'Software'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'Software'  +  i ). show () 
        } 

        **for**  ( **let**  i  =  0 ;  i  <  optionsAccessory . length ;  i ++) { 
            //console.log("mmmmmmooooooo  i, optionsAccessory[i].label ==> ", i, '#' + sel + 'AccessoryText' + i, optionsAccessory[i].label) 
            $w ( '#'  +  sel  +  'AccessoryText'  +  i ). text  =  optionsAccessory [ i ]. label 
            $w ( '#'  +  sel  +  'AccessoryAlias'  +  i ). text  =  optionsAccessory [ i ]. alias 
            $w ( '#'  +  sel  +  'Accessory'  +  i ). value  =  optionsAccessory [ i ]. value 
            $w ( '#'  +  sel  +  'AccessoryText'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'AccessoryText'  +  i ). show () 
            $w ( '#'  +  sel  +  'Accessory'  +  i ). expand (); 
            $w ( '#'  +  sel  +  'Accessory'  +  i ). show () 

        } 

    } 
    **if**  ( software  ==  0  &&  accessory  ==  0  ) {   // no Software and no Accessories 

        $w ( '#'  +  sel  +  'Optional' ). text  =  "No optional software or accessories available for this product." 
        $w ( '#'  +  sel  +  'Optional' ). expand (); 
        $w ( '#'  +  sel  +  'Optional' ). show (); 

        $w ( '#'  +  sel  +  'SoftwareHeader' ). hide (); 
        $w ( '#'  +  sel  +  'SoftwareHeader' ). collapse (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). hide (); 
        $w ( '#'  +  sel  +  'GroupSoftware' ). collapse (); 

        $w ( '#'  +  sel  +  'AccessoryHeader' ). hide (); 
        $w ( '#'  +  sel  +  'AccessoryHeader' ). collapse (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). hide (); 
        $w ( '#'  +  sel  +  'GroupAccessory' ). collapse () 

    } 


} 
//}) 
//.catch( (err) => { 
//$w('#message').text = "Error retrieving data"; 
//$w('#message').show(); 
//      //console.log ("Error retrieving data"); 
//}); 

//console.log ("uuuuuuuuuuuuuuuuuuuuuuuuuuuuu here I am ====> ", $w('#' + sel + 'SoftwareText0').text) 

//console.log(".out.......................async populateCheckboxes............................."); 

}

208 lines of code is not a minimum scenario. What happens on what line of code? What does it have to do with a TextBox element? Where do you get the error?

As you stated, "in the variable called “labelSoftware”. So…

Your line of code:

labelSoftware= "sku: " +results.items[i].sku+ "...   price: " +labelPrice+ "...    " +labelSoftware

Using your line of code (with semicolons included), here is my minimum scenario:

    let str =  "sku: " + 555 + ";   price: " + 22.55 + ";    " + 'label';
    console.log('str', str);

My minimum scenario code works with no problem. Therefore, the semicolon in the string is not the issue. Perhaps it could be with your data? What are the contents of results.items[I].sku? labelPrice? labelSoftware?

Please realize that in order to identify the problem, we need a bare minimum scenario. We really can’t debug complex code.

Yes, I get it. I learned to code in standard languages like fortran and visual basic. There the code runs sequentially and is easy to debug and there is no issue with long subroutines. In Velo/Javascript the code runs synchronously so it has been significantly difficult, nearly impossible, for me to think in terms of small disconnected functions. My programming mind works sequentially, even now. My new website has the normal stuff, but two pages are extremely customized for building a quotation that is highly product-selection dependent. All works fine in Preview mode, but have random failures in Publish mode.

I will take your minimal line of code and plug it into the function that was not working and see what happens. Will get back to you on this.

Again, I appreciate your help.

Ah - Fortran! I learned on Fortran II, Watfor, PL/1, and 360 assembler. Fun days.

OK, so let me know how it goes.

Visual Basic in Excel is very similar to Basic, Fortran, and DAFT. While you await my test, can you answer my question about site monitoring?

By the way, the Table on the quote page stopped working again. The database is there but the table does not render.

Sorry - forgot about that…

I’m really not aware of any reference for that message. Do you know what line of code generated this message? Are you retrieving data in a JSON?

@yisrael-wix I think the answer to your JSON question is yes. All Site Monitoring messages can be clicked to see the JSON string. That is what I showed you earlier. But If you don’t use Site Monitoring, that I guess you would not know that. Which beings up the question, what type of code execution monitoring do you use? I tried the Chrome one discussed on Wix site and elsewhere, but I can’t figure out how to make it work for my purposes, which is to add breakpoints and single step execution and see what is happening. I do that in Excel VBA very effectively … it is quick to find bugs.

In answer to your earlier question about text box, I probably misled you in my ignorance. The page element that is being read in the offending code is NOT an “input” TextBox. It is a simple Text field I reference as in $w ( ‘#’ + item + Tape + “Text” + i ). text . Does this matter?

I don’t see in the code where you are getting the .text property from the element. All I see is that you are setting the .text property in code.

You’ll have to dig in and find if any of those statements are in error or are causing the strange error message.

Yes, I have been doing that now. Lots of console logs. Early indication is I may have inadvertently mixed variable types in the definition of the text field.

Yisrael, Thanks again for your help.

You asked me to let you know how my testing goes. Well, after 2 days of working on isolating the error, I was able to recreate a simple page you can build on your end to demonstrate the problem. In my own code I am getting the array data from a database. Here is just declared arrays for processing, but I have used exactly the same strings that come out of the database. Copy the code below but redirect to one of your own pages (mine is /quote).

When I use "… " in the string as a visual delimiter, his works perfectly. When I use "; " it fails with 2 errors on the first screen element. In the //comments below in the code I entered the Site Monitoring results as well.

Curiously, if I put all the code inside of the $w . onReady function then I get success regardless of which delimiter I use.

import wixLocation from ‘wix-location’ ;

$w . onReady ( function () {
});

let stringArray1 = ;
stringArray1 . push ( “sku: 8040.725.004” );
stringArray1 . push ( “price: $290.00” );
stringArray1 . push ( “Carlson Wooden Tripod w/ Dual Clamp…” );

let stringArray2 = ;
stringArray2 . push ( “sku: 8040.725.002” );
stringArray2 . push ( “price: $130.00” );
stringArray2 . push ( “Carlson Label Fiberglass Tripod…” );

let text1 = stringArray1 [ 0 ] + "; " + stringArray1 [ 1 ] + "; " + stringArray2 [ 2 ]
let text2 = stringArray2 [ 0 ] + "; " + stringArray2 [ 1 ] + "; " + stringArray2 [ 2 ]

//let text1 = stringArray1[0] + "… " + stringArray1[1] + "… " + stringArray2[2]
//let text2 = stringArray2[0] + "… " + stringArray2[1] + "… " + stringArray2[2]

$w ( ‘#instrumentAccessoryText0’ ). text = text1
$w ( ‘#instrumentAccessoryText1’ ). text = text2

let element0 = $w ( ‘#instrumentAccessoryText0’ ). text
let element1 = $w ( ‘#instrumentAccessoryText1’ ). text

console . log ( "element 0 = " , element0 )
console . log ( "element 1 = " , element1 )

wixLocation . to ( “/quote” ); //This line redirects to the quote form page

// Publish Mode, used "; " as separator
// Failure! The page element fields were updated. But ERRORS in Site Monitoring and page DID NOT redirect to /quote.
// Site Monitoring output
//09/01/2021, 12:04:08.000 PM Loading the code for the Code Testing 2 page. To debug this code, open dtn5t.js in Developer Tools. INFO
//09/01/2021, 12:04:08.000 PM There was an error in your script at console.error (https://static.parastorage.com/services/wix-… ERROR
//09/01/2021, 12:04:08.000 PM TypeError: Illegal invocation at P (eval at evaluateBundle (https://jimyaccino.wixsite.com/_part… ERROR

// Publish Mode, used "… " as separator
// Success! The page element fields were updated, no errors in Site Monitoring, and the page redirected to /quote.
// Site Monitoring output
//09/01/2021, 12:07:58.000 PM Loading the code for the Code Testing 2 page. To debug this code, open dtn5t.js in Developer Tools. INFO
//09/01/2021, 12:07:58.000 PM element 0 = sku: 8040.725.004… price: $290.00… Carlson Label Fiberglass Tripod… INFO
//09/01/2021, 12:07:58.000 PM element 1 = sku: 8040.725.002… price: $130.00… Carlson Label Fiberglass Tripod… INFO

Wow! You wrote…
Curiously, if I put all the code inside of the $w . onReady function then I get success regardless of which delimiter I use.

Not so curiously. Screen elements defined by the $w selector are only accessible in event handlers such as onReady(), onClick(), etc; and will not work otherwise. In fact, I’m not sure how it even partly worked.

So for example, the following code must be in the page’s onReady():

$w('#instrumentAccessoryText0').text=text1
$w('#instrumentAccessoryText1').text=text2

Your code seems OK, it’s just in the wrong place. So, not so curiously, if you put all of your code in the page’s onReady() function, your code should work just fine.

And just to be clear, page elements can also be accessed inside of other event handlers such as onClick().

Yes, WOW for sure…why did this work at all, right? Everything works in Preview mode fails in Publish mode!! Thanks for your comment on onReady and other event handlers. I search high and low to find something that says what you wrote. I guess it is there but I missed it. Good stuff!

Now I will return to my original code page which kicked off this whole discussion to see if this rule has been violated anywhere.

I am hoping this will help resolve the other 2 issues I am having with Tables AND databases not being properly updated. Are there any similar rules related to Tables or to databases?