REMINDER
Debugging in Preview Mode
-
I was trying to debug a script in preview mode (Chrome > Inspect) and noticed a whole list of warnings an info's. Any idea what might be wrong? Or are you not supposed to debug in preview mode?
-
I would DEFINITELY not debug in PageBuilder's Preview mode
You'll be seeing a lot of PageBuilder and AppDrag specific messages, which will make finding your own code and working on it much more difficult than it should be.
Each time you 'save' in PageBuilder, however, it saves a full copy of that page in www.yoursite.com/preview/yourpage.html so you can simply open a browser, navigate there, and debug from there. No need to publish.
Pro tip:
Due to cloudFlare's caching (according to your own AppDrag caching preferences, 30s by default), you may have to add a random URL parameter to the end of the URL. This causes CloudFlare to think it's potentially a new request, and therefore invalidates the cache.Example: www.yoursite.com/preview/yourpage.html?a=b
Then if you want to make sure you are running the latest code after saving, just add a random character to the end like
www.yoursite.com/preview/yourpage.html?a=b2
www.yoursite.com/preview/yourpage.html?a=b21
www.yoursite.com/preview/yourpage.html?a=b214
www.yoursite.com/preview/yourpage.html?a=b2146etc.
Cheers
-
@Daniel-Mulroy thanks Daniel! BTW: I found that you if you force reloading the page also works ... Shift-Cmd-R on macOS