JavaScript in Landing Page Template | Community
Skip to main content
Jo_Pitts1
Community Manager
July 29, 2020
Solved

JavaScript in Landing Page Template

  • July 29, 2020
  • 1 reply
  • 3612 views

All,

I have a situation where I have some JS written directly into a Landing Page Template.

 

I want to debug said JS.  I'm using Chrome for this.  When I hit F12 and go to sources, I can't find the LPT code anywhere.   I did a 'search all files' and typed in a variable name I know exists in the code, and that turned up nothing.

 

As per usual, I am sure I am being super blind and or super dense.  Any help would be appreciated.

 

Cheers

Jo

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jo_Pitts1

I hunted down through the iframes and still couldn't see what I was looking for.

I'm happy to screen share with you if you have time.


All,

with @sanfordwhiteman 's help we found a cunning answer.  If you can't get the chrome devtools to surface the code, then put this line of code

debugger;

where you want to debug in your Landing Page Template.  It'll force the chrome devtools to bring this code into view.  From then you can apply other breakpoints and or start stepping through your code.

 

A tiny bit odd, but super handy. 

1 reply

SanfordWhiteman
New Participant
July 29, 2020

Definitely the main doc would be under Sources, and AFAIK can't be black-boxed. What's the URL?

Jo_Pitts1
Jo_Pitts1Author
Community Manager
July 29, 2020

@sanfordwhiteman , its a template URL so I'm not sure I can expose it to you?

SanfordWhiteman
New Participant
July 29, 2020

If you're in the Template preview, the doc would be in an IFRAME.