Jump to content

Strange Code issue

Go to solution Solved by creedon,

Recommended Posts

Posted (edited)

For some inexplicable reason, if I add any working code to any page (except for my 7.0 landing/home page) header code injection and then at some point delete the code,  the page  goes completly white on all desktop browsers that I have. I then have to add some working code back into the header injection and the page restores itself. I don't think this is an SS wide problem. I suspect that there is  some strange interaction with some of my custom css. Any other folks experiencing this?

Edited by derricksrandomviews
Posted

Hmm... the body tag is pretty much devoid of content.

1360307683_ScreenShot2022-12-14at1_06_24PM.thumb.png.8bcbf3c966a7d320abe21a0d4b72e5b6.png

My first thought is an error in the source that is causing a DOM rendering issue but I'm not seeing the usual signs of DOM weirdness that can often be seen while examining elements in the inspector.

I've gone to the source for the page and there is more there.

758612240_ScreenShot2022-12-14at1_13_19PM.thumb.png.15223ed92fb040367da62b151a514c72.png

I then used w3.org markup validator to see if it can help point out issues and it seems to have found some. The first one that jumped out was the following.

359120081_ScreenShot2022-12-14at1_27_30PM.png.188d4c8e32fa87caa498cdc03e157edf.png

The following code is missing a closing tag.

<style>
#header a:active{
 text-decoration: underline !important;
}
#header a:hover{
 text-decoration: underline !important;
}
div.folder.active{
 text-decoration: underline !important;
}

I added it in locally and reloaded the page.

1462484220_ScreenShot2022-12-14at1_31_10PM.thumb.png.61a1aef2a046c1fba5c969a2ecf8bba1.png

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Posted (edited)

I added your code in advanced header code injection along with the closing tag and it did not restore the page. Is there a way I can load the tag in the proper place?  I added this code in code injection header and it also restored the page: 

<style>sqs-gallery-block-slideshow .sqs-gallery-controls .next,
.sqs-gallery-block-slideshow .sqs-gallery-controls .previous {
  background: none; /*removes the original background behind the arrows*/
}
.sqs-gallery-block-slideshow .sqs-gallery-controls .next::before,
.sqs-gallery-block-slideshow .sqs-gallery-controls .previous::before {
  background: white;
  color: black;
  font-size: 1.1em; /*this changes the size of the arrows*/
  padding: 10px;
  border-radius: 50%; /*remove this is you don't want the background rounded*/
}</style>

Edited by derricksrandomviews
Posted
51 minutes ago, derricksrandomviews said:

I added your code in advanced header code injection along with the closing tag and it did not restore the page.

I should have been more clear. I did not add the code. I added the missing style close tag to that code because it was missing the close tag.

Is the code I show your custom code or SS default code?

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Posted (edited)

It is custom code I added in settings/advanced/header code injection to add underllines on my Nav bar items:

You found where the problem lies. I deleted the code and the page now works as it should. I would like to have the underline back, and I appear to have done that. I removed the <style> tags and posted the code in Design/Custom CSS as opposed to header injection and all appears to be working now. Thank you Creedon for finding where this bug originated. The code had been in the header injection for a long time, not sure why it broke, and still did not work after adding <style> at the end. 

#header a:active {
 text-decoration: underline !important;
}
#header a:hover {
 text-decoration: underline !important;
}
div.folder.active {
 text-decoration: underline !important;
}
 

Edited by derricksrandomviews
  • Solution
Posted (edited)
Quote

Thank you Creedon for finding where this bug originated. The code had been in the header injection for a long time, not sure why it broke

My pleasure to serve.

My only guess on why it manifested now after so long a time would be SS made some subtle changes to either the template or their backend.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.