Jump to content

Code briefly showing before page loads

Recommended Posts

Hi.

On my client's website on the WORK page there is a line of code that appears for a second before the page loads (also happens on mobile). Weirdly the code that flashes up is actually being used to target the SERVICES page to keep the depth of the cards consistent and it's working fine.  I just don't know a) why it's showing at all   and b) why it would show on the WORK page and not the page that it's relevant to.   The code is in the Custom CSS along with all my other code that is working fine and not showing on any of the pages before loading. 

I've attached a screengrab of the line of code that appears briefly.  (you'll have to expand it to be able to read)

You should be able to see it if you load https://www.coco-comms.me/work

Thanks in advance for any tips to get rid of it!

 

Screenshot 2023-02-01 at 12.38.36.png

Link to comment

You have style code injected into the header but without any style (or other tags) around it, so it gets loaded as text. You'll want to locate and remove it (it's currently not doing anything) or place it within style tags if you do need it.

image.thumb.png.e4a36e3f247c817649b4f80dae93ffe3.png

Let me know if that works, and give me a thumbs up here if you can, thanks!

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
🔌
 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 Did I help? Buy me a coffee?

Link to comment
  • 3 weeks later...

Hi Ziggy, sorry for late response!  

Thanks very much for your suggestion, but I don't have any code injected into the header (in the Advanced > Code Injection section of Squarespace it is completely empty).  This is what is so strange.  I have several bits of CSS code in the Design> Custom CSS box but it's specifically only this line that is appearing when the WORK page loads.  It's doing the job of keeping the boxes on the Services page a consistent size, but even if I delete this line of code from Custom CSS it still shows up when loading the WORK page.  I just can't work it out -  it's almost like it's being pulled from somewhere else.  

Scratching my head...

Link to comment
4 minutes ago, Pinkers said:

Hi Ziggy, sorry for late response!  

Thanks very much for your suggestion, but I don't have any code injected into the header (in the Advanced > Code Injection section of Squarespace it is completely empty).  This is what is so strange.  I have several bits of CSS code in the Design> Custom CSS box but it's specifically only this line that is appearing when the WORK page loads.  It's doing the job of keeping the boxes on the Services page a consistent size, but even if I delete this line of code from Custom CSS it still shows up when loading the WORK page.  I just can't work it out -  it's almost like it's being pulled from somewhere else.  

Scratching my head...

Do you have code injection for that specific page?

Link to comment

The code that is showing is for the SERVICES page:

/* equal height of list cards SERVICES */
@media screen and (min-width:600px) {
.user-items-list-item-container[data-section-id="61df0ea5974d4f33fe32e432"] .list-item-content__description {
    min-height: 500px;
}
}

 

But weirdly that code loads when you go to the WORK page... https://www.coco-comms.me/work

You'll see it flash up before the page loads.

Link to comment

Just to clarify, all the code that I've put into Custom CSS is doing it's job - it's all working properly.   It's just that the code that is targeting the Services page is flashing up on the Work page before it loads.  

Link to comment

@Pinkers There is a header code injection for each page, found in the Page Settings -> Advanced, have you looked in there?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
🔌
 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 Did I help? Buy me a coffee?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.