I have connected #text10 with dataset value and it is loaded as expected. But on load page when I access the element
$w.onReady(function () { var textgiven = $w("text10").text;
// its value is what was set on editor and not whats loaded by dataset.
how can i get the loaded text without user intervantion.
onChange() does not evoked on dataset changing the value.
it seems that the onready is activated before dataset action.
I get #total is not a valid selector in page code editor
import wixData from 'wix-data'; $w.onReady( () => { $w("#total").onReady( () => { let itemObj = $w("#total").getCurrentItem(); console.log(itemObj); $w("#html1").postMessage("test"); } ); });
Hi.
You can use the getCurrentItem() function to get the dataset's current item when the page loads. To learn more, check out our API here.
Regards!