I’m new to Wix and I’m trying to learn the platform but I’m running into some issues with adding JavaScript code to my pages. I can’t even get a message to log to the console. Any ideas on how to enable javascript code on my site?
I added this code to the main site to see if any messages would appear in the developer console, but I’m not seeing anything being logged.
$w.onReady(function () {
//TODO: write your page related code here…
console.log(‘test’);
});
Roi,
I’m just running the site in preview mode and not in a published site, so I’m not sure about how to share that with you. It looks like when I publish the site, the javascript code does run and I see the logs in the developer console, but I’d also like to see those logs in the unpublished site in preview mode for testing purposes. Any ideas on why the js code would not be running in preview mode?
I am also having issues with Javascript, this is just a simple widget, yet it does not want to load. Any help or insight is appreciate. The code is as follows…