I need help with getting the $w.onReady() function to be called on my product page. I've the same code in my product gallerie pages which works fine. When I put the code in the product page it doesn't seem to fire the $w.onReady() function. All I'm trying to do is an Insert into a database collection. Can anyone help?
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
![feature fixed.png](https://static.wixstatic.com/media/3bfa8a_f845e1016b8a49758acdd6edd6610c3b~mv2.png/v1/crop/x_0,y_2,w_852,h_508/fill/w_104,h_62,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/feature%20fixed.png)
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Greetings, it's not clear whether or not you are using a dataset. If so, you need to add an onReady for that too so that you are assured that the dataset is loaded before adding a record.
$w.onReady(function () { $w('#dataset1').onReady( () => { $w('#dataset1').new(); }) })
I was able to add a record in preview mode in the onReady function of a product page with the wixData.insert command.